[#98621] Re: Function getlogin_r()'s protoype] — Bertram Scharpf <lists@...>
FYI,
3 messages
2020/06/02
[#98947] [Ruby master Feature#16986] Anonymous Struct literal — ko1@...
Issue #16986 has been reported by ko1 (Koichi Sasada).
66 messages
2020/06/26
[#98962] [Ruby master Bug#16988] Kernel.load loads file from current directory without '.' in path — misharinn@...
Issue #16988 has been reported by TheSmartnik (Nikita Misharin).
5 messages
2020/06/26
[#98969] [Ruby master Feature#16994] Sets: shorthand for frozen sets of symbols / strings — marcandre-ruby-core@...
Issue #16994 has been reported by marcandre (Marc-Andre Lafortune).
7 messages
2020/06/26
[#100117] [Ruby master Feature#16994] Sets: shorthand for frozen sets of symbols / strings
— matz@...
2020/09/25
Issue #16994 has been updated by matz (Yukihiro Matsumoto).
[ruby-core:98719] [Ruby master Bug#12706] Hash#each yields inconsistent number of args
From:
marcandre-ruby-core@...
Date:
2020-06-10 19:33:12 UTC
List:
ruby-core #98719
Issue #12706 has been updated by marcandre (Marc-Andre Lafortune).
Interesting. Does it intend to fix just this case, or any inconsistencies I listed in https://bugs.ruby-lang.org/issues/14015 ?
@eregon: given the current state of affairs, I consider lambdas & multiple yield a very bad idea until things make some sense.
----------------------------------------
Bug #12706: Hash#each yields inconsistent number of args
https://bugs.ruby-lang.org/issues/12706#change-86074
* Author: bughit (bug hit)
* Status: Closed
* Priority: Normal
* Backport: 2.1: UNKNOWN, 2.2: UNKNOWN, 2.3: UNKNOWN
----------------------------------------
```ruby
def foo(a, b)
p [a, b]
end
def bar(a, b = 2)
p [a, b]
end
foo_lambda = method(:foo).to_proc
bar_lambda = method(:bar).to_proc
{a: 1}.each(&foo_lambda)
{a: 1}.each(&bar_lambda)
```
From #12705, yielding to method lambdas uses lambda/method arg semnatics
the yield to foo produces `[:a, 1]` suggesting that each is yielding two values `yield key, value`
but yield to bar produces `[[:a, 1], 2]` suggesting that each is yielding one value `yield [key, value]`
it would be better if you always knew what to expect from it
--
https://bugs.ruby-lang.org/
Unsubscribe: <mailto:ruby-core-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>