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=-3.7 required=3.0 tests=AWL,BAYES_00, 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 831021F461 for ; Thu, 11 Jul 2019 10:00:48 +0000 (UTC) Received: from neon.ruby-lang.org (localhost [IPv6:::1]) by neon.ruby-lang.org (Postfix) with ESMTP id BAC8A120AFB; Thu, 11 Jul 2019 19:00:40 +0900 (JST) Received: from o1678948x4.outbound-mail.sendgrid.net (o1678948x4.outbound-mail.sendgrid.net [167.89.48.4]) by neon.ruby-lang.org (Postfix) with ESMTPS id 46B9B120AC2 for ; Thu, 11 Jul 2019 19:00:38 +0900 (JST) Received: by filter0173p3mdw1.sendgrid.net with SMTP id filter0173p3mdw1-25347-5D2708C7-69 2019-07-11 10:00:39.839225597 +0000 UTC m=+664684.716278238 Received: from herokuapp.com (unknown [54.80.150.68]) by ismtpd0034p1iad2.sendgrid.net (SG) with ESMTP id i1fPsANCTkiU4djDY16a6w for ; Thu, 11 Jul 2019 10:00:39.863 +0000 (UTC) Date: Thu, 11 Jul 2019 10:00:39 +0000 (UTC) From: knu@ruby-lang.org Message-ID: References: Mime-Version: 1.0 X-Redmine-MailingListIntegration-Message-Ids: 69174 X-Redmine-Project: ruby-trunk X-Redmine-Issue-Id: 15973 X-Redmine-Issue-Author: alanwu X-Redmine-Sender: knu 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?hDsQvKErLSJ7pAc+tDc0a0gaAYeRBj5seyyxgbnjKEmPwqpVXmoFG1qjpwLnHl?= =?us-ascii?Q?txpCYopuZ+DV65WbHjvghJoUxF6aVB5clh+GscS?= =?us-ascii?Q?nVEfkwlJIPLaMQHPl9mrAwOgD8RFhUzjz6xcxD2?= =?us-ascii?Q?R=2F1OvOnlYtfUV5iY+=2F11tl4g3uLxXOvV2a91jMt?= =?us-ascii?Q?WPDzwi+O+oYKzNX+zn6rG2scOKDQ6yvPnVQ=3D=3D?= To: ruby-core@ruby-lang.org X-ML-Name: ruby-core X-Mail-Count: 93679 Subject: [ruby-core:93679] [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 knu (Akinori MUSHA). I don't think the lambda flag should be altered after the creation of a proc, because it's all up to the writer of a block how `return`/`break` etc. in a block should work. What about just deprecate `lambda` in the long run in favor of the lambda literal `->() {}`? ---------------------------------------- Feature #15973: Make it so Kernel#lambda always return a lambda https://bugs.ruby-lang.org/issues/15973#change-79290 * Author: alanwu (Alan Wu) * Status: Open * Priority: Normal * Assignee: * 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/