Created
July 17, 2013 01:18
-
-
Save JonRowe/6016855 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Thing | |
def [] a, &block | |
block.call a | |
end | |
end | |
thing = Thing.new | |
# explicit works fine | |
thing[:a,&(-> a { puts a })] | |
# implicit won't even parse | |
# thing[:a] { |a| puts a } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
There is nothing wrong with the syntax, it is just that Ruby19 does not support this correctly yet (ref http://nuclearsquid.com/writings/ruby-1-9-what-s-new-what-s-changed/)
I'd rewrite it to: