[#69616] [Ruby trunk - Feature #11258] add 'x' mode character for O_EXCL — cremno@...
Issue #11258 has been updated by cremno phobia.
3 messages
2015/06/16
[#69643] [Ruby trunk - Misc #11276] [RFC] compile.c: convert to use ccan/list — normalperson@...
Issue #11276 has been updated by Eric Wong.
3 messages
2015/06/17
[#69751] [Ruby trunk - Bug #11001] 2.2.1 Segmentation fault in reserve_stack() function. — kubo@...
Issue #11001 has been updated by Takehiro Kubo.
3 messages
2015/06/27
[ruby-core:69572] [Ruby trunk - Bug #11048] blocks raise on missing and extra keyword args
From:
alxtskrnk@...
Date:
2015-06-13 18:36:54 UTC
List:
ruby-core #69572
Issue #11048 has been updated by bug hit.
Yukihiro Matsumoto wrote:
> For example, `loop` method passes loop counter to the block. You can safely ignore this by arity tolerance. This is a reason behind it. But there's no benefit for keyword arguments tolerance, as far as I see, but demerit of late error detection.
>
> Matz.
If you believe there's value in being able to ignore args you don't care about, I don't see why it would not apply to keyargs. The difference is not so fundamental, both are used to pass data to the block. One might switch to keyargs for yield, to make the code clearer, but there would be no expectation of this difference in behavior.
----------------------------------------
Bug #11048: blocks raise on missing and extra keyword args
https://bugs.ruby-lang.org/issues/11048#change-52910
* Author: bug hit
* Status: Open
* Priority: Normal
* Assignee: Yukihiro Matsumoto
* ruby -v: ruby 2.2.1p85 (2015-02-26 revision 49769) [x86_64-linux]
* Backport: 2.0.0: UNKNOWN, 2.1: UNKNOWN, 2.2: UNKNOWN
----------------------------------------
blocks intentionally tolerate arity mismatches
```
irb(main):001:0> proc{|a, b| [a, b]}.(1)
[
[0] 1,
[1] nil
]
irb(main):003:0> proc{|a, b|[a, b]}.(1, 2, 3)
[
[0] 1,
[1] 2
]
```
so why not missing keyword args?
```
irb(main):002:0> proc{|a:, b:|[a, b]}.(a: 1)
ArgumentError: missing keyword: b
irb(main):004:0> proc{|a:, b:|[a, b]}.(a: 1, b: 1, c: 1)
ArgumentError: unknown keyword: c
```
--
https://bugs.ruby-lang.org/