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=-4.1 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, 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 400BD1F97E for ; Wed, 28 Nov 2018 01:29:21 +0000 (UTC) Received: from neon.ruby-lang.org (localhost [IPv6:::1]) by neon.ruby-lang.org (Postfix) with ESMTP id 5FB69120D8F; Wed, 28 Nov 2018 10:29:18 +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 DCA03120D6E for ; Wed, 28 Nov 2018 10:29:14 +0900 (JST) Received: by filter0016p3iad2.sendgrid.net with SMTP id filter0016p3iad2-9072-5BFDEF67-37 2018-11-28 01:29:11.844466502 +0000 UTC m=+870723.900282844 Received: from herokuapp.com (ec2-54-167-29-183.compute-1.amazonaws.com [54.167.29.183]) by ismtpd0001p1iad2.sendgrid.net (SG) with ESMTP id Bixruw14TgS14gyzvjzljA for ; Wed, 28 Nov 2018 01:29:11.831 +0000 (UTC) Date: Wed, 28 Nov 2018 01:29:12 +0000 (UTC) From: gfuji@cpan.org To: ruby-core@ruby-lang.org Message-ID: References: Mime-Version: 1.0 X-Redmine-MailingListIntegration-Message-Ids: 65501 X-Redmine-Project: ruby-trunk X-Redmine-Issue-Id: 15352 X-Redmine-Issue-Author: gfx X-Redmine-Sender: gfx 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: ync6xU2WACa70kv/Ymy4QrNMhiuLXJG8OTL2vJD1yS6oQIDnddC4gaDdOxH/XGT+6N6KeifVZCvDRn 6SfKfxMckESoA6vW1Ms9GWBw8BoHPfdvnVhdydRRHGeWDWBzNbSOSilklReumV49RkfS0LiUYSJC5k YYC63zqBL75kI381ArMO+QrfbYzaSFxiA6mV X-ML-Name: ruby-core X-Mail-Count: 90105 Subject: [ruby-core:90105] [Ruby trunk Feature#15352] Mandatory block parameters 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 #15352 has been reported by gfx (Goro FUJI). ---------------------------------------- Feature #15352: Mandatory block parameters https://bugs.ruby-lang.org/issues/15352 * Author: gfx (Goro FUJI) * Status: Open * Priority: Normal * Assignee: * Target version: ---------------------------------------- There are too many block parameter assertions (it's kind of idioms: [`raise NoBlockGiven unless glock_given?`](https://github.com/search?q=raise+NoBlockGiven+unless+block_given&type=Code)). It's very useful if there's a syntax to declare mandatory block parameters, such as: ```ruby def foo(&!block) block.call end foo() # raises ArgumentError "in `foo`: no block given" ``` -- https://bugs.ruby-lang.org/