[#120465] [Ruby master Bug#20998] rb_str_locktmp() changes flags of frozen strings and string literals — "Eregon (Benoit Daloze) via ruby-core" <ruby-core@...>
Issue #20998 has been reported by Eregon (Benoit Daloze).
17 messages
2025/01/03
[ruby-core:120570] [Ruby master Bug#20974] Required and optional anonymous parameter show differently in Proc#parameters
From:
"mame (Yusuke Endoh) via ruby-core" <ruby-core@...>
Date:
2025-01-09 11:36:38 UTC
List:
ruby-core #120570
Issue #20974 has been updated by mame (Yusuke Endoh).
Discussed at the dev meeting. @matz said that it should return `[[:opt]]` instead of `[[:opt, nil]]`.
----------------------------------------
Bug #20974: Required and optional anonymous parameter show differently in Proc#parameters
https://bugs.ruby-lang.org/issues/20974#change-111394
* Author: alanwu (Alan Wu)
* Status: Open
* Backport: 3.1: UNKNOWN, 3.2: UNKNOWN, 3.3: UNKNOWN
----------------------------------------
The following has had the same output since Ruby 1.9, when Proc#parameters was [introduced]:
```ruby
p(proc { |(_a)| }.parameters) # => [[:opt, nil]]
p(lambda { |(_a)| }.parameters) # => [[:req]]
```
I think they should be `[[:opt]]` and `[[:req]]` or `[[:opt, nil]]` and `[[:req, nil]]`. I prefer the nil-free option since that feels more anonymous.
[introduced]: https://docs.ruby-lang.org/en/master/NEWS/NEWS-1_9_2.html
--
https://bugs.ruby-lang.org/
______________________________________________
ruby-core mailing list -- ruby-core@ml.ruby-lang.org
To unsubscribe send an email to ruby-core-leave@ml.ruby-lang.org
ruby-core info -- https://ml.ruby-lang.org/mailman3/lists/ruby-core.ml.ruby-lang.org/