From: "matz (Yukihiro Matsumoto)" Date: 2013-03-27T05:43:51+09:00 Subject: [ruby-core:53748] [ruby-trunk - Bug #8168][Feedback] Feature request: support for (single) statement lambda syntax/definition Issue #8168 has been updated by matz (Yukihiro Matsumoto). Status changed from Open to Feedback Assignee set to matz (Yukihiro Matsumoto) =begin What if the lambda takes the parameter e.g. (({->(x){x*x}}))? Matz. =end ---------------------------------------- Bug #8168: Feature request: support for (single) statement lambda syntax/definition https://bugs.ruby-lang.org/issues/8168#change-37945 Author: garysweaver (Gary Weaver) Status: Feedback Priority: Normal Assignee: matz (Yukihiro Matsumoto) Category: Target version: ruby -v: ruby 1.9.3p392 (2013-02-22 revision 39386) [x86_64-darwin11.4.2] Abstract: Proposal for single statement lambda support, either via a new type of stab '->>', such that '->> some value;' would be equivalent to '-> {some value;}', or by just supplying a stab operator '->' with a value instead of a block (which would be more intuitive). Background: Often proc and lambda blocks are one statement long. Braces or do/end in this case are mostly unnecessary and result in less beautiful code Pros: may reduce amount of syntax required, especially if can re-use same operator. Cons: different stab operator may be confusing because of similarity to existing lambda operator. With either proposal, may cause additional overhead for interpreters. -- http://bugs.ruby-lang.org/