On Mon, May 5, 2008 at 1:21 PM, David A. Black <dblack / rubypal.com> wrote:
> Hi --
>
>
>
>  On Tue, 6 May 2008, Paul Brannan wrote:
>
>
> > On Tue, May 06, 2008 at 02:07:26AM +0900, ts wrote:
> >
> > >  This is just me which associate, probably wrongly, lambda and
> > >  define_method and 1.9 seems have method argument semantics with
> > >  lambda
> > >
> >
> > Hmm, you seem (as usual) to be correct.  What, then, is the purpose of
> > the -> syntax, if these are equivalent:
> >
> >  p = lambda { |x, y, &b| ... }
> >  p = ->(x, y, &b) { ... }
> >
> > (or am I mistaken in thinking they are equivalent?)
> >
> > If they are the same, then I'm content to just not use -> in my own
> > code.
> >
>
>  See my response to Guy. ->() lets you do method-argument semantics:
>
>   ->(a,b=1) {}
>
>  whereas this blows up:
>
>   lambda {|a,b=1| }

I guess it should be made clear that you are talking just about
argument semantics then because methods have other differences
including closures, yield, break and friends, etc..

Brian.