ruby-dev (Japanese) list archive (unofficial mirror)
 help / color / mirror / Atom feed
From: "shugo (Shugo Maeda)" <noreply@ruby-lang.org>
To: ruby-dev@ml.ruby-lang.org
Subject: [ruby-dev:52027]  [Ruby master Feature#19134] ** is not allowed in def foo(...)
Date: Thu, 15 Dec 2022 12:26:48 +0000 (UTC)	[thread overview]
Message-ID: <redmine.journal-100678.20221215122647.12@ruby-lang.org> (raw)
In-Reply-To: <redmine.issue-19134.20221117092700.12@ruby-lang.org>

Issue #19134 has been updated by shugo (Shugo Maeda).


mame (Yusuke Endoh) wrote in #note-12:
> I feel that only `&` is acceptable since a block is implicitly passed. But I don't think `*` and `**` make sense inside `def foo(...)`.

Speaking of implicity of blocks, `def f; g(&); end` causes a syntax error, so it may be better to allow it, or disallow `def f(...); g(&); end` in the future versions.
Anyway, I've fixed the behavior of `...` as described in #note-9.

----------------------------------------
Feature #19134: ** is not allowed in def foo(...)
https://bugs.ruby-lang.org/issues/19134#change-100678

* Author: shugo (Shugo Maeda)
* Status: Closed
* Priority: Normal
* Assignee: matz (Yukihiro Matsumoto)
* Target version: 3.2
----------------------------------------
`*` 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/

  parent reply	other threads:[~2022-12-15 12:27 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-17  9:27 [ruby-dev:51203] " shugo (Shugo Maeda)
2022-11-28  8:16 ` [ruby-dev:52003] " shugo (Shugo Maeda)
2022-11-28 22:39 ` [ruby-dev:52004] " matz (Yukihiro Matsumoto)
2022-11-29  2:57 ` [ruby-dev:52006] " shugo (Shugo Maeda)
2022-12-04 18:04 ` [ruby-dev:52009] " Eregon (Benoit Daloze)
2022-12-04 18:08 ` [ruby-dev:52010] " Eregon (Benoit Daloze)
2022-12-04 22:48 ` [ruby-dev:52011] " shugo (Shugo Maeda)
2022-12-04 23:46 ` [ruby-dev:52012] " shugo (Shugo Maeda)
2022-12-12 14:04 ` [ruby-dev:52021] " Eregon (Benoit Daloze)
2022-12-14  7:12 ` [ruby-dev:52025] " mame (Yusuke Endoh)
2022-12-15 12:26 ` shugo (Shugo Maeda) [this message]
2022-12-15 13:47 ` [ruby-dev:52028] " Eregon (Benoit Daloze)

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=redmine.journal-100678.20221215122647.12@ruby-lang.org \
    --to=noreply@ruby-lang.org \
    --cc=ruby-dev@ml.ruby-lang.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).