From: Josh Cheek Date: 2011-10-05T11:54:32+09:00 Subject: Re: Local vs method vs instance (was: Operator Overloading) --20cf307f3254b209b404ae8453fb Content-Type: text/plain; charset=ISO-8859-1 On Tue, Oct 4, 2011 at 9:06 PM, Gary Wright wrote: > > On Oct 4, 2011, at 5:15 PM, Adam Prescott wrote: > > As far as I know, ->{} is absolutely no different from lambda {}. > > > I'm not sure what bugs me so much about 'stabby lambda' but I just don't > like it. The only advantage I can see is that since it is syntax, there > might be some parse-time optimization that can be employed during > construction of the lambda. Since 'lambda' is a method invocation and not a > keyword these optimizations might not be possible with 'lambda'. Charles > Nutter might have some words of wisdom on that since it is similar to the > obstacles associated with eval being a method and not a keyword. > > Gary Wright > > I've started using it in RSpec. -> { whatever }.should_not raise_error lambda { whatever }.should_not raise_error I prefer the former. Almost all the rest of the time, I prefer the latter. --20cf307f3254b209b404ae8453fb--