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: X-Spam-Status: No, score=-2.9 required=3.0 tests=AWL,BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_BL_SPAMCOP_NET,SPF_HELO_PASS, SPF_PASS,UNPARSEABLE_RELAY shortcircuit=no autolearn=no autolearn_force=no version=3.4.2 Received: from nue.mailmanlists.eu (nue.mailmanlists.eu [IPv6:2a01:4f8:1c0c:6b10::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id 0554F1F4C1 for ; Tue, 29 Nov 2022 02:58:16 +0000 (UTC) Authentication-Results: dcvr.yhbt.net; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=ruby-lang.org header.i=@ruby-lang.org header.b="Av24E9Tr"; dkim-atps=neutral Received: from nue.mailmanlists.eu (localhost [127.0.0.1]) by nue.mailmanlists.eu (Postfix) with ESMTP id 1DB9A7E7D4; Tue, 29 Nov 2022 02:58:02 +0000 (UTC) Authentication-Results: nue.mailmanlists.eu; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=ruby-lang.org header.i=@ruby-lang.org header.a=rsa-sha256 header.s=s1 header.b=Av24E9Tr; dkim-atps=neutral Received: from xtrwkhkc.outbound-mail.sendgrid.net (xtrwkhkc.outbound-mail.sendgrid.net [167.89.16.28]) by nue.mailmanlists.eu (Postfix) with ESMTPS id 0E1D97E7C9 for ; Tue, 29 Nov 2022 02:57:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ruby-lang.org; h=from:references:subject:mime-version:content-type: content-transfer-encoding:list-id:to:cc; s=s1; bh=vh7mr5Ch5FFEeKcqHNdPVWrFvc3CasYEUFpS/Z+IdAs=; b=Av24E9TrolO8wzI9rIN2dLqQoxGtbSN+izm7uhxmpEPjWSJYnIGAYbHtPY4W4cdniDEY iqfVRgA5p/T5aG1j1Cq7P4qT+FRyEGSRZSbUT5+juTbOXT818a/it3BQZ43Zb+UKTei5qZ hJFrx3orF1aVHgEVkEA3fHZt3GYa45KDo6jJlFYBmLD/ZfAk4heVz9N1dAahBmL3wV4CHF al0tdBbrJHh0RQt2i/JUwYwQeLA8AIlPsn8S51UxcM0p0a5KX6QaV3g0jaVzAL+5YyrWJo ipDKzIVoKMRy0n5/YnFzr91tWjg/CkBedRJr+W+3BMKRjN/8GCbmckPjvC4md5Dw== Received: by filterdrecv-557d69979-tvnm7 with SMTP id filterdrecv-557d69979-tvnm7-1-63857532-3 2022-11-29 02:57:54.156293972 +0000 UTC m=+964334.274666179 Received: from herokuapp.com (unknown) by geopod-ismtpd-5-6 (SG) with ESMTP id ZXOupFuVSTOY4aM3cHth7A for ; Tue, 29 Nov 2022 02:57:54.026 +0000 (UTC) Date: Tue, 29 Nov 2022 02:57:54 +0000 (UTC) From: "shugo (Shugo Maeda)" Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Redmine-Project: ruby-master X-Redmine-Issue-Tracker: Feature X-Redmine-Issue-Id: 19134 X-Redmine-Issue-Author: shugo X-Redmine-Issue-Assignee: matz X-Redmine-Sender: shugo 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-Redmine-MailingListIntegration-Message-Ids: 87395 X-SG-EID: =?us-ascii?Q?o0C=2FsDUd4ZFGiDZCTbvVjqibxcpCfydz4lwnBQWyXZ+Plw=2FfhrG0CQPbrktOPX?= =?us-ascii?Q?NfKIrb7bilCwkXET66DNxoL+kAg34fRc=2FJ39u3f?= =?us-ascii?Q?7fZ3qbvYzqjm3gJuP=2FMs2SyXG6XqYsQzw6ty2X8?= =?us-ascii?Q?9suHLHnR2SQJJj3nIZOXpSm1eD6FT8NZSVchF7Z?= =?us-ascii?Q?IS6bsuacnWMGA3m+SceWQ9LizZdvBJ4EabF11Ij?= =?us-ascii?Q?Bmb148bvkNiXPmjXB1Va3TcavF0YHvRIUG1bFvU?= =?us-ascii?Q?n2k+Wia8JpjmooV82jPKQ=3D=3D?= To: ruby-dev@ml.ruby-lang.org X-Entity-ID: b/2+PoftWZ6GuOu3b0IycA== Message-ID-Hash: D74EPFAMGFX2DBC6UI6EQBNIVPLAIB36 X-Message-ID-Hash: D74EPFAMGFX2DBC6UI6EQBNIVPLAIB36 X-MailFrom: bounces+313651-12dc-ruby-dev=ml.ruby-lang.org@em5188.ruby-lang.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.3 Precedence: list Reply-To: "Ruby developers (Japanese)" Subject: =?utf-8?q?=5Bruby-dev=3A52006=5D_?= [Ruby master Feature#19134] ** is not allowed in def foo(...) List-Id: "Ruby developers (Japanese)" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Issue #19134 has been updated by shugo (Shugo Maeda). matz (Yukihiro Matsumoto) wrote in #note-2: > LGTM. Thank you. I've merged it. I realized that my fix also chaged the behavior of the following code: ```ruby def foo(*, **, &) bar(...) end def bar(*args, **kw, &block) p [args, kw, block&.call] end foo(1, 2, x: 3, y: 4) { 5 } ``` My fix changed the result from `[[1, 2], {}, 5]` to `[[1, 2], {:x=>3, :y=>4}, 5]`. So `...` is now a syntax sugar of `*, **, &`. ---------------------------------------- Feature #19134: ** is not allowed in def foo(...) https://bugs.ruby-lang.org/issues/19134#change-100306 * Author: shugo (Shugo Maeda) * Status: Closed * Priority: Normal * Assignee: matz (Yukihiro Matsumoto) ---------------------------------------- `*` and `&` are allowed in the body of a method with `...` argument forwarding, but `**` is not allowed. ``` def foo(...) bar(*) # OK baz(&) # OK quux(**) # NG end ``` Is it intended behavior? It seems that parse.y has code like `#ifdef RUBY3_KEYWORDS`, and if RUBY3_KEYWORDS, `**` will also be supported. -- https://bugs.ruby-lang.org/