From: "Ara.T.Howard" Date: 2005-10-13T00:53:39+09:00 Subject: Re: Default argument values for blocks On Thu, 13 Oct 2005, Christophe Grandsire wrote: > Selon "Ara.T.Howard" : > >>> >>> |Hey, what about ":(foo="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 >> good >>> |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="bar"){puts foo} >>> | >>> |isn't that bad :) . >>> >>> I have never thought of that. Hmm, let me think about it during the >>> conference trip. I'm leaving tomorrow morning. >> >> but >> >> method bool ? 42 : (0b101010) { "block" } >> >> is valid now. >> > > Does it mean "method(bool ? 42 : (0b101010)) { "block"}"? yes. > Also, doesn't the presence of the "?" make the ":" unambiguous in this case? > Just asking, I really don't know. probably. i don't know either. just seem potentially confounding. cheers. -a -- =============================================================================== | email :: ara [dot] t [dot] howard [at] noaa [dot] gov | phone :: 303.497.6469 | Your life dwells amoung the causes of death | Like a lamp standing in a strong breeze. --Nagarjuna ===============================================================================