From: Eric Mahurin Date: 2008-05-26T14:47:58+09:00 Subject: Re: [PATCH] lambda with normal block syntax ------=_Part_7956_13531919.1211780911820 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline On Sun, May 25, 2008 at 8:19 PM, Nobuyoshi Nakada wrote: > Hi, > > At Sun, 25 May 2008 16:30:42 +0900, > Eric Mahurin wrote in [ruby-core:16886]: > > This patch is an independent but related one to my previous one. It can > be > > combined to allow for normal block syntax lambdas with default arguments. > > This patch allows you to make lambda's more concisely by simply removing > the > > "lambda": > > That syntax had been introduced once, but deprecated. > I looked back in the svn history to find this. It looks like it was introduced here: r8044 | nobu | 2005-03-01 21:21:31 -0600 (Tue, 01 Mar 2005) | 9 lines * parse.y (expr): interpret mere do...end block as proc object. * parse.y (primary): ditto, for brace block. and then removed when the "->" came along. r8847 | matz | 2005-07-27 02:27:19 -0500 (Wed, 27 Jul 2005) | 19 lines * parse.y (lambda): Perl6 style -> lambda expression. [NEW] [VERY EXPERIMENTAL] So, it looks like this patch is just a reimplementation of the r8044 checkin (which was removed at r8847). Could we go back to having what was in r8044 along with the new -> lambda for some more trials? From my understanding of the -> in perl6, it looks to have chosen for places ruby would use blocks. It can be used in ruby in the block context, so I don't think it makes sense for ruby. I see almost nobody likes the syntax. What was the reason for the -> lambda introduced in r8847 over the do/end or {||} lambda from r8044? Was it default arguments? If so, could my first patch be used for default arguments (use primary instead of expr for default vaule to resolve | ambiguity) instead? Eric ------=_Part_7956_13531919.1211780911820 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline On Sun, May 25, 2008 at 8:19 PM, Nobuyoshi Nakada <nobu@ruby-lang.org> wrote:
Hi,

At Sun, 25 May 2008 16:30:42 +0900,
Eric Mahurin wrote in [ruby-core:16886]:
> This patch is an independent but related one to my previous one.  It can be
> combined to allow for normal block syntax lambdas with default arguments.
> This patch allows you to make lambda's more concisely by simply removing the
> "lambda":

That syntax had been introduced once, but deprecated.

I looked back in the svn history to find this.  It looks like it was introduced here:

r8044 | nobu | 2005-03-01 21:21:31 -0600 (Tue, 01 Mar 2005) | 9 lines
* parse.y (expr): interpret mere do...end block as proc object.
* parse.y (primary): ditto, for brace block.

and then removed when the "->" came along.

r8847 | matz | 2005-07-27 02:27:19 -0500 (Wed, 27 Jul 2005) | 19 lines
* parse.y (lambda): Perl6 style -> lambda expression. [NEW]
  [VERY EXPERIMENTAL]

So, it looks like this patch is just a reimplementation of the r8044 checkin (which was removed at r8847).

Could we go back to having what was in r8044 along with the new -> lambda for some more trials?  From my understanding of the -> in perl6, it looks to have chosen for places ruby would use blocks.  It can be used in ruby in the block context, so I don't think it makes sense for ruby.  I see almost nobody likes the syntax.

What was the reason for the -> lambda introduced in r8847 over the do/end or {||} lambda from r8044?  Was it default arguments?  If so, could my first patch be used for default arguments (use primary instead of expr for default vaule to resolve | ambiguity) instead?

Eric

------=_Part_7956_13531919.1211780911820--