From: Yukihiro Matsumoto Date: 2005-08-05T08:22:46+09:00 Subject: Re: new block notation (was: Re: ruby-dev summary 26468-26661) Hi, In message "Re: new block notation (was: Re: ruby-dev summary 26468-26661)" on Fri, 5 Aug 2005 07:55:54 +0900, Eric Mahurin writes: |So before, the experiment was this (no default args and |ambiguities with Hash): | |f = { |a| ... } | |and now you are thinking about this: | |f = ->(a) { ... } | |To me, this suffers readability because there are too many |symbols in a row: =->( Wasn't this kind of thing the primary |problem with perl - too many punctuation characters made it |difficult to read. I don't agree. Punctuation symbol nor sequence of them itself is not a problem. The problems can be caused by context dependent interpretation of symbols, I think. |It seems like you are between a rock and a hard place |(preserving backwards compatibility) to solve this problem. I |don't see one great solution. The best I can come up with is |to use syntax like we have now except a) use symbols other than || that allow no ambiguity in the expressions (I think :+space |would work), and b) force an argument list to not cause |ambiguities. So you'd have this: | |f = { : a,b=1|2 : ... } |f = { : * : ... } # equivalent to f = lambda { ... } Unfortunately :+space causes conflicts as well. matz.