Skip to content

Instantly share code, notes, and snippets.

@adelcambre
Created February 16, 2011 19:22
Show Gist options
  • Save adelcambre/829969 to your computer and use it in GitHub Desktop.
Save adelcambre/829969 to your computer and use it in GitHub Desktop.
rbx-head :001 > foo
NameError: undefined local variable or method `foo' on an instance of Object.
from Kernel(Object)#foo (method_missing) at kernel/delta/kernel.rb:85
from { } in Object#irb_binding at (irb):1
rbx-head :002 > foo = 123 if false
=> nil
rbx-head :003 > foo
=> nil
@smerritt
Copy link

Perl does the same thing. my $foo = 1 if false defines $foo, but its value is undef.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment