http://briancarper.net/blog/579/keyword-arguments-ruby-cloju...
This reminds me of everything I love, but also everything I hate, about Ruby. He writes:
------
With even more added sugar, you can leave off the parens in Ruby function calls. So this is pretty common in Ruby:
foo :x => 123 # => {:x=>123}
How nice and punctuation-less. But then things get ugly. What about this?
foo {:x => 123}
That won't even compile.
You can do `foo d: {:y => 2}` or `foo :d => {:y => 2}` but not a raw hash literal without parens.
That's parse.y[1] for you...
[1]: https://github.com/ruby/ruby/blob/trunk/parse.y
http://briancarper.net/blog/579/keyword-arguments-ruby-cloju...
This reminds me of everything I love, but also everything I hate, about Ruby. He writes:
------
With even more added sugar, you can leave off the parens in Ruby function calls. So this is pretty common in Ruby:
foo :x => 123 # => {:x=>123}
How nice and punctuation-less. But then things get ugly. What about this?
foo {:x => 123}
That won't even compile.