[ruby-core:78209] Re: [Ruby trunk Feature#12901] Anonymous functions without scope lookup overhead
From:
Matthew Kerwin <matthew@...>
Date:
2016-11-19 00:02:15 UTC
List:
ruby-core #78209
On 19/11/2016, [email protected] <[email protected]> wrote: > Issue #12901 has been updated by Colin Fulton. > > This would be a fantastic feature. I second the idea of something like > `function { }`, `func { }`, `<> { }`, `--> { }`, `->> { }`, or `<-> { }`. > > Would these behave like regular Procs or lambda Procs when it comes to > return semantics and arty checking? I personally think it would be useful to > have both types, but having four variants of anonymous functions in Ruby > might be a bit overwrought. > I think it makes sense and would be useful for a 'function' to have strict arity checking and return from the anonymous function, like a lambda or a method. -- Matthew Kerwin http://matthew.kerwin.net.au/ Unsubscribe: <mailto:[email protected]?subject=unsubscribe> <http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>