On Mon, May 26, 2008 at 5:48 PM, Yukihiro Matsumoto <matz / ruby-lang.org> wrote:

> Personally I don't like
>
>   meth {|a| a+1}, {|b| b*2}
>
> which can be parsed
>
>   (meth() {|a| a+1}), ({|b| b*2})
>
> or
>
>   meth({|a| a+1}, {|b| b*2})
>
> or whatever.  I dislike this kind of ambiguity.

This is very understandable as you are really in between, if you see
what I mean. However might it not be an interesting idea to
make some abstraction of parsing first, see what people or you like
most from an esthetical or readability point of view and only than
go back to see if it can be implemented consistently, which of course
is an important issue too. Ok I am aware that this might

I really like the {||} and do...end symantics Eric's proposing, but I
agree with Matz that before we tried it out for some time we should
remain conservative on this (is this really me, saying conservative??? ;).

Cheers
Robert
  In fact, you would
> expect the latter, but I'm afraid Eric's patch gives you the former.
> This could be a very evidence of (bad) ambiguity.  That's why I asked
> people to try the patch.
>
> Perhaps it works better with Groovy's semantics of block passing (last
> explicit argument with slightly different call syntax).  But not with
> Ruby's implicit argument style, which I am not going to change.
>
> |I'd also argue that the {|a| } makes for a better language. My
> |experience teaching this stuff shows that people are confused by the
> |large number of different options that surround blocks. Unifying block
> |parameters with method parameters, and then removing the need for this
> |somewhat strange -> notation, will reduce the number of special cases,
> |and make it a lot easier for people to understand the language. And
> |that's a major cognition win.
>
> This notation introduces something new (a block without any attached
> method, or lambda), with syntax almost indistinguishable from existing
> one (a block attached to a method).  I hesitate to give too similar
> syntax to something different.  The point should be how different (in
> recognition) a block without attached method (lambda) and an usual
> block in Ruby.  I see them different (at least in Ruby).  Others may
> not.
>
> |Please, please consider adding both these patches into 1.9.
>
> * block parameter with default argument patch: likely.
> * block without attached method patch: need more persuasion.
>
>                                                        matz.
>
>



-- 
http://ruby-smalltalk.blogspot.com/

---
Whereof one cannot speak, thereof one must be silent.
Ludwig Wittgenstein