Skip to content

Instantly share code, notes, and snippets.

@ejfinneran
Created November 26, 2012 03:03
Show Gist options
  • Save ejfinneran/4146405 to your computer and use it in GitHub Desktop.
Save ejfinneran/4146405 to your computer and use it in GitHub Desktop.
Ruby Const WAT

MRI

1.9.3-p194 :011 > [1, 2, 3].each {|X| puts X }
SyntaxError: (irb):11: formal argument cannot be a constant
[1, 2, 3].each {|X| puts X }
                  ^
	from /Users/ej/.rvm/rubies/ruby-1.9.3-p194/bin/irb:16:in `<main>'

Makes perfect sense

1.9.3-p194 :012 > for X in [1, 2, 3]; puts X; end
1
(irb):12: warning: already initialized constant X
2
(irb):12: warning: already initialized constant X
3
 => [1, 2, 3] 

WAT

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