[#74190] [Ruby trunk Feature#12134] Comparison between `true` and `false` — duerst@...
Issue #12134 has been updated by Martin D端rst.
3 messages
2016/03/07
[#74269] Type systems for Ruby — Rob Blanco <ml@...>
Dear ruby-core,
5 messages
2016/03/10
[#74395] [Ruby trunk Feature#12142] Hash tables with open addressing — shyouhei@...
Issue #12142 has been updated by Shyouhei Urabe.
3 messages
2016/03/17
[ruby-core:74218] [Ruby trunk Bug#10708] In a function call, double splat of an empty hash still calls the function with an argument
From:
justcolin@...
Date:
2016-03-08 04:59:35 UTC
List:
ruby-core #74218
Issue #10708 has been updated by Colin Fulton.
#12022 has some further exploration of this bug.
----------------------------------------
Bug #10708: In a function call, double splat of an empty hash still calls the function with an argument
https://bugs.ruby-lang.org/issues/10708#change-57354
* Author: Damien Robert
* Status: Assigned
* Priority: Normal
* Assignee: Yukihiro Matsumoto
* ruby -v: ruby 2.2.0p0 (2014-12-25 revision 49005) [x86_64-linux]
* Backport: 2.0.0: UNKNOWN, 2.1: UNKNOWN, 2.2: UNKNOWN
----------------------------------------
Consider this:
~~~ruby
def foo; end
foo(*[]) #Splatting an empty list is ok
foo(**{}) #Double splatting an empty hash is like calling foo({}) which gives an error
~~~
This is annoying in a function that is a wrapper around another function and just process some keywords:
~~~ruby
def wrapper(*args, keyword: true, **others)
puts keyword
wrappee(*args,**others) #here this code will fail if others is empty
end
~~~
--
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>