David A. Black wrote: > Hi -- > > On Wed, 12 Oct 2005, Christophe Grandsire wrote: > > > However, it's nearly impossible a problem to solve. Any solution will probably > > look rather awful. We just need to find the least offensive one :) . Unless one > > finds a way to parse "{|foo="bar"| puts foo}" correctly. That'd be the best > > solution. > > > > > > >> The => in the hash syntax is IMHO already one kind of arrow too much. > >> > > > > Hasn't a change been accepted that allows one to use ":" as an alternative to > > "=>" in hashes? > > > > 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 :) . > > But it's so arbitrary. Surely there's no general principle of "being > used to" a given punctuation mark that makes it acceptable for > something like this. > > I don't mean to jump on your idea specifically. The whole thread > seems to be about which arbitrary bit of punctuation might be least > ugly. I'm totally unconvinced that default values for block variables > are worth doing any of them. > > I totally agree, David. I can't believe that we're about to mess up Ruby's syntax because someone asked for default values for block variables. I hope this idea is really well discussed at Rubyconf. I can't think of a time that I thought "you know, I really could use to have default values for block variables". Since it is such a special case and it's easy to work around I can't see messing with one of the most recognizable bits or Ruby syntax (as in, if I see "array.each{|foo| ... }" I know immediately I'm looking at Ruby code). There's a discussion of this over at http://Redhanded.hobix.com where the assumption seems to be that this proposed '->' syntax is going to replace the current 'goalpost' syntax '{|..|}'. Someone please say this isn't so. Phil