Project

General

Profile

Actions

Feature #15973

closed

Let Kernel#lambda always return a lambda

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

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0