Project

General

Profile

ActionsLike0

Feature #15973

closed

Let Kernel#lambda always return a lambda

Added by alanwu (Alan Wu) almost 6 years ago. Updated over 3 years ago.

Status:
Closed
Target version:
[ruby-core:93482]

Description

When Kernel#lambda receives a Proc that is not a lambda,
it returns it without modification. l propose to change Kernel#lambda
so it always returns a lambda.

Calling a method called lambda and having it do nothing in effect is
not very intuitive.

https://github.com/ruby/ruby/pull/2262

Judging from marcandre's investigation here: https://bugs.ruby-lang.org/issues/15620#note-1,
changing the behavior should not cause much breakage, if any.

This also happens to fix [Bug #15620]


Related issues 8 (1 open7 closed)

Related to Ruby - Feature #12957: A more OO way to create lambda ProcsFeedbackActions
Related to Ruby - Feature #7314: Convert Proc to Lambda doesn't work in MRIAssignedmatz (Yukihiro Matsumoto)Actions
Related to Ruby - Feature #9777: Feature Proposal: Proc#to_lambdaFeedbackActions
Related to Ruby - Feature #8693: lambda invoked by yield acts as a proc with respect to returnClosedktsj (Kazuki Tsujimoto)07/26/2013Actions
Related to Ruby - Bug #16004: Kernel#lambda captured with Kernel#method doesn't create lambdasClosedActions
Related to Ruby - Bug #15620: Block argument usage affects lambda semanticClosedko1 (Koichi Sasada)Actions
Related to Ruby - Feature #16499: define_method(non_lambda) should not change the semantics of the given ProcRejectedActions
Related to Ruby - Feature #17361: lambda(&block) does not warn with lazy proc allocationClosedko1 (Koichi Sasada)Actions
#2

Updated by alanwu (Alan Wu) almost 6 years ago

  • Subject changed from Make Kernel#lambda always return lambda to Make it so Kernel#lambda always return a lambda
#4

Updated by shyouhei (Shyouhei Urabe) over 5 years ago

  • Related to Feature #12957: A more OO way to create lambda Procs added
#5

Updated by shyouhei (Shyouhei Urabe) over 5 years ago

  • Related to Feature #7314: Convert Proc to Lambda doesn't work in MRI added
#18

Updated by akr (Akira Tanaka) over 5 years ago

  • Related to Feature #9777: Feature Proposal: Proc#to_lambda added
#19

Updated by akr (Akira Tanaka) over 5 years ago

  • Related to Feature #8693: lambda invoked by yield acts as a proc with respect to return added
#23

Updated by Eregon (Benoit Daloze) over 5 years ago

  • Related to Bug #16004: Kernel#lambda captured with Kernel#method doesn't create lambdas added

Updated by ko1 (Koichi Sasada) over 5 years ago

  • Status changed from Open to Assigned
  • Assignee set to matz (Yukihiro Matsumoto)
#30

Updated by sawa (Tsuyoshi Sawada) over 5 years ago

  • Subject changed from Make it so Kernel#lambda always return a lambda to Let Kernel#lambda always return a lambda
  • Description updated (diff)
#32

Updated by Eregon (Benoit Daloze) over 5 years ago

  • Related to Bug #15620: Block argument usage affects lambda semantic added

Updated by Eregon (Benoit Daloze) over 5 years ago

  • Target version set to 36
#45

Updated by Eregon (Benoit Daloze) about 5 years ago

  • Related to Feature #16499: define_method(non_lambda) should not change the semantics of the given Proc added
#47

Updated by jeremyevans (Jeremy Evans) almost 5 years ago

  • Status changed from Assigned to Closed
#48

Updated by hsbt (Hiroshi SHIBATA) over 4 years ago

  • Target version changed from 36 to 3.0
#49

Updated by znz (Kazuhiro NISHIYAMA) over 4 years ago

  • Related to Feature #17361: lambda(&block) does not warn with lazy proc allocation added
ActionsLike0

Also available in: Atom PDF