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.8 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 85D351F4C0 for ; Sun, 20 Oct 2019 12:07:22 +0000 (UTC) Received: from neon.ruby-lang.org (localhost [IPv6:::1]) by neon.ruby-lang.org (Postfix) with ESMTP id 9FA4F120996; Sun, 20 Oct 2019 21:07:12 +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 462E8120995 for ; Sun, 20 Oct 2019 21:07:09 +0900 (JST) Received: by filter0177p3mdw1.sendgrid.net with SMTP id filter0177p3mdw1-4221-5DAC4DEF-51 2019-10-20 12:07:11.776201035 +0000 UTC m=+225642.115464883 Received: from herokuapp.com (unknown [184.73.140.113]) by ismtpd0071p1iad2.sendgrid.net (SG) with ESMTP id WVBydVvDQf-DtzPcptwc0w for ; Sun, 20 Oct 2019 12:07:11.750 +0000 (UTC) Date: Sun, 20 Oct 2019 12:07:11 +0000 (UTC) From: nobu@ruby-lang.org Message-ID: References: Mime-Version: 1.0 X-Redmine-MailingListIntegration-Message-Ids: 71030 X-Redmine-Project: ruby-trunk X-Redmine-Issue-Id: 16253 X-Redmine-Issue-Author: Dan0042 X-Redmine-Sender: nobu 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?q8Dly+pU2+3ektTtZVXgZtbJPXwqo7p86jCsvYTW4ByRThNDDFcwBZCnZgPWWt?= =?us-ascii?Q?BXT4FhnqSSAgXL2JHKE5Vf0Zvj6TMnm5=2Fv5qyRk?= =?us-ascii?Q?QGCnxWj49JUI+1sLisze0lff4Wuw7UuIgy4V6jq?= =?us-ascii?Q?HhTySsiLFqO93FqJ9HXYFOtwEib7K8RVe=2F2g0cR?= =?us-ascii?Q?rKFL0NLrUVvUpoKSg9ecFoRI7P90J30Fcvg=3D=3D?= To: ruby-core@ruby-lang.org X-ML-Name: ruby-core X-Mail-Count: 95439 Subject: [ruby-core:95439] [Ruby master Feature#16253] Shorthand "forward everything" syntax 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 #16253 has been updated by nobu (Nobuyoshi Nakada). ioquatix (Samuel Williams) wrote: > I think `...` should be remainder of arguments that aren't explicitly consumed. If it is the remainder, then it should be placed after all explicit arguments? ```ruby def foo(pre, opt = nil, *rest, kw:, &block, ...) ``` ---------------------------------------- Feature #16253: Shorthand "forward everything" syntax https://bugs.ruby-lang.org/issues/16253#change-82191 * Author: Dan0042 (Daniel DeLorme) * Status: Open * Priority: Normal * Assignee: * Target version: ---------------------------------------- What about using this: ```ruby def foo(*) @bar.foo(*) ``` to mean this: ```ruby def foo(*a, **o, &b) @bar.foo(*a, **o, &b) ``` I used `def foo(*)` because that's currently valid ruby code, but I'm fine with any syntax. It's like the no-parentheses `super` shorthand, but for any method. It makes it easier to write correct forwarding code. If rubyists must be told they have to change their forwarding code in 2.7 (due to keyword arguments), the pill might be easier to swallow if the change is a reduction rather than an increase in verbosity. And we'd even be future-proof if an eventual FOURTH kind of parameter is introduced!!!! -- https://bugs.ruby-lang.org/