From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS4713 221.184.0.0/13 X-Spam-Status: No, score=-1.8 required=3.0 tests=AWL,BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from neon.ruby-lang.org (neon.ruby-lang.org [221.186.184.75]) by dcvr.yhbt.net (Postfix) with ESMTP id 9C9401F462 for ; Tue, 30 Jul 2019 13:31:13 +0000 (UTC) Received: from neon.ruby-lang.org (localhost [IPv6:::1]) by neon.ruby-lang.org (Postfix) with ESMTP id E27B4120C1E; Tue, 30 Jul 2019 22:31:06 +0900 (JST) Received: from o1678916x28.outbound-mail.sendgrid.net (o1678916x28.outbound-mail.sendgrid.net [167.89.16.28]) by neon.ruby-lang.org (Postfix) with ESMTPS id 7C3B3120B63 for ; Tue, 30 Jul 2019 22:31:04 +0900 (JST) Received: by filter0137p3mdw1.sendgrid.net with SMTP id filter0137p3mdw1-9826-5D40469B-37 2019-07-30 13:31:07.524733489 +0000 UTC m=+326029.408654710 Received: from herokuapp.com (unknown [18.234.65.111]) by ismtpd0004p1iad1.sendgrid.net (SG) with ESMTP id hdOq-0jmSp27yrdEsoa2Pg for ; Tue, 30 Jul 2019 13:31:07.500 +0000 (UTC) Date: Tue, 30 Jul 2019 13:31:07 +0000 (UTC) From: matz@ruby.or.jp Message-ID: References: Mime-Version: 1.0 X-Redmine-MailingListIntegration-Message-Ids: 69561 X-Redmine-Project: ruby-trunk X-Redmine-Issue-Id: 15973 X-Redmine-Issue-Author: alanwu X-Redmine-Issue-Assignee: matz X-Redmine-Sender: matz X-Mailer: Redmine X-Redmine-Host: bugs.ruby-lang.org X-Redmine-Site: Ruby Issue Tracking System X-Auto-Response-Suppress: All Auto-Submitted: auto-generated X-SG-EID: =?us-ascii?Q?bXEIHGfdFwsIlBTndiToCp=2Fmc2rfxRD2sZAksRKJIHU136E6Lh+TNo+OZNjty2?= =?us-ascii?Q?tBSh4NO7=2FDH5FZnp7AxB0Av48rMGQbXhFArxRo3?= =?us-ascii?Q?J661custw4ANOfFhUfXgR9CqJoPRYFIIVwWgp54?= =?us-ascii?Q?pAb9s1UiFRn1ZP56PGBX3qSpNiYII8oOpyR3xHx?= =?us-ascii?Q?aagur02E7UzrY?= To: ruby-core@ruby-lang.org X-ML-Name: ruby-core X-Mail-Count: 94054 Subject: [ruby-core:94054] [Ruby master Feature#15973] Make it so Kernel#lambda always return a lambda X-BeenThere: ruby-core@ruby-lang.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: Ruby developers List-Id: Ruby developers List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ruby-core-bounces@ruby-lang.org Sender: "ruby-core" Issue #15973 has been updated by matz (Yukihiro Matsumoto). I agree with @akr here, as long as `lambda` with a block argument warns. We need to keep compatibility. But I think we should warn this inconsistent behavior. Matz. ---------------------------------------- Feature #15973: Make it so Kernel#lambda always return a lambda https://bugs.ruby-lang.org/issues/15973#change-80282 * Author: alanwu (Alan Wu) * Status: Assigned * Priority: Normal * Assignee: matz (Yukihiro Matsumoto) * Target version: ---------------------------------------- When Kernel#lambda receives a Proc that is not a lambda, it returns it without modification. l propose changing `Kernel#lambda` so it always returns a lambda. Calling a method called lambda and having it effective do nothing was 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] -- https://bugs.ruby-lang.org/