Forums
New posts
Search forums
Members
Current visitors
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Forums
Archive
Archive
Ruby
Default argument values for blocks
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
Reply to thread
Message
[QUOTE="Christophe Grandsire, post: 4487244"] I have and can only concur. The arrows make things pretty confusing in mo= st places. The problem is that "collection.each lambda(foo=3D"bar") {puts foo}" has = to be the ugliest and most long-winded thing I've seen in a long time. It's OK for = making a Proc, but to use as a block it's just plain wrong. However, it's nearly impossible a problem to solve. Any solution will pro= bably look rather awful. We just need to find the least offensive one :) . Unle= ss one finds a way to parse "{|foo=3D"bar"| puts foo}" correctly. That'd be the = best solution. Hasn't a change been accepted that allows one to use ":" as an alternativ= e to "=3D>" in hashes? Hey, what about ":(foo=3D"bar"){puts foo}"? It's still not beautiful but = it's still less annoying, and in Ruby we are already used to see colons at the beginning of a word. Of course, overloading ":" may not be considered a g= ood idea, but it shouldn't be a parsing problem as this one would always be followed by a "(" (and that doesn't happen with symbols). And: collection.each:(foo=3D"bar"){puts foo} isn't that bad :) . -- Christophe Grandsire. [URL]http://rainbow.conlang.free.fr[/URL] It takes a straight mind to create a twisted conlang. [/QUOTE]
Verification
Post reply
Forums
Archive
Archive
Ruby
Default argument values for blocks
Top