[#88925] [Ruby trunk Feature#15095] [PATCH] share VM stack between threads and fibers if identical — ko1@...
Issue #15095 has been updated by ko1 (Koichi Sasada).
4 messages
2018/09/09
[#88927] Re: [Ruby trunk Feature#15095] [PATCH] share VM stack between threads and fibers if identical
— Eric Wong <normalperson@...>
2018/09/09
[email protected] wrote:
[#88926] [Ruby trunk Feature#15095] [PATCH] share VM stack between threads and fibers if identical — ko1@...
Issue #15095 has been updated by ko1 (Koichi Sasada).
3 messages
2018/09/09
[#89218] [Ruby trunk Bug#15130] open-uri hangs on cygwin — duerst@...
SXNzdWUgIzE1MTMwIGhhcyBiZWVuIHVwZGF0ZWQgYnkgZHVlcnN0IChNYXJ0aW4gRMO8cnN0KS4K
5 messages
2018/09/30
[ruby-core:89065] [Ruby trunk Bug#15078] Hash splat of empty hash should not create a positional argument.
From:
akr@...
Date:
2018-09-18 13:07:47 UTC
List:
ruby-core #89065
Issue #15078 has been updated by akr (Akira Tanaka).
mame (Yusuke Endoh) wrote:
> akr (Akira Tanaka) wrote:
> > How about def `m(**kw) end` binds kw to nil if the last Hash argument is not taken as keyword arguments and
> > `m(**{})` add {} and `m(**nil)` don't add anything to arguments.
>
> I agree that it is one of the reasonable design choices, but does it break the following code?
>
> ```
> def foo(**kw)
> kw[:key]
> end
>
> foo()
> ```
Yes. I hope that the incompatibility is acceptable.
If it is not acceptable, I have second idea:
We can use a special frozen empty Hash object instead of nil.
```
NO_KEYWORD_ARGUMENTS = {}.freeze
```
In this idea, the condition of "no keyword argument" is represented as
`NO_KEYWORD_ARGUMENTS.equal?(x)` instead of `nil.equal?(x)`.
It is still incompatible because it is not modifiable, though.
```
def foo(**kw) kw[0] = 1 end; foo()
```
If kw is bind to NO_KEYWORD_ARGUMENTS, `kw[0] = 1` raises FrozenError.
Also, more importantly, it adds a new constant and
we (Ruby programmers) need to remember the name.
----------------------------------------
Bug #15078: Hash splat of empty hash should not create a positional argument.
https://bugs.ruby-lang.org/issues/15078#change-74088
* Author: marcandre (Marc-Andre Lafortune)
* Status: Open
* Priority: Normal
* Assignee: matz (Yukihiro Matsumoto)
* Target version:
* ruby -v: ruby 2.6.0dev (2018-08-27 trunk 64545) [x86_64-darwin15]
* Backport: 2.3: UNKNOWN, 2.4: UNKNOWN, 2.5: UNKNOWN
----------------------------------------
Looks like #10856 is not completely fixed, but I can't reopen it
```
def foo(*args); args; end
foo(**{}) # => []
foo(**Hash.new) # => [{}], should be []
```
--
https://bugs.ruby-lang.org/
Unsubscribe: <mailto:[email protected]?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>