[#73707] [Ruby trunk Misc#12004] Code of Conduct — hanmac@...
Issue #12004 has been updated by Hans Mackowiak.
3 messages
2016/02/05
[#73730] [Ruby trunk Feature#12034] RegExp does not respect file encoding directive — nobu@...
Issue #12034 has been updated by Nobuyoshi Nakada.
3 messages
2016/02/07
[#73746] [Ruby trunk Feature#12034] RegExp does not respect file encoding directive — nobu@...
Issue #12034 has been updated by Nobuyoshi Nakada.
3 messages
2016/02/09
[#73919] [Ruby trunk Feature#11262] Make more objects behave like "Functions" — Ruby-Lang@...
SXNzdWUgIzExMjYyIGhhcyBiZWVuIHVwZGF0ZWQgYnkgSsO2cmcgVyBNaXR0YWcuCgpQcm9qZWN0
3 messages
2016/02/22
[#74019] [Ruby trunk Bug#12103][Rejected] ruby process hangs while executing regular expression. — duerst@...
SXNzdWUgIzEyMTAzIGhhcyBiZWVuIHVwZGF0ZWQgYnkgTWFydGluIETDvHJzdC4KClN0YXR1cyBj
3 messages
2016/02/27
[ruby-core:73951] [Ruby trunk Bug#12104] Procs keyword arguments affect value of previous argument
From:
public@...
Date:
2016-02-23 10:26:54 UTC
List:
ruby-core #73951
Issue #12104 has been updated by Brian Underwood.
Looking deeper now it seems to be that this is because the first argument is an Array and that when that happens it's interpreting that as the elements of the array being the arguments of the Proc. Is that supposed to happen?
----------------------------------------
Bug #12104: Procs keyword arguments affect value of previous argument
https://bugs.ruby-lang.org/issues/12104#change-57100
* Author: Brian Underwood
* Status: Open
* Priority: Normal
* Assignee:
* ruby -v: Tested in 2.3.0 and 2.2.3
* Backport: 2.0.0: UNKNOWN, 2.1: UNKNOWN, 2.2: UNKNOWN, 2.3: UNKNOWN
----------------------------------------
This seems like a bug to me:
~~~
2.3.0 :001 > p = Proc.new {|nodes, match_array: false| puts nodes.inspect }
=> #<Proc:0x007fa52c0659e0@(irb):1>
2.3.0 :002 > p.call([])
nil
=> nil
2.3.0 :003 > p.call([], match_array: true)
[]
=> nil
~~~
When I try the same thing in a method I get the behavior I would expect:
~~~
2.3.0 :004 > def foo(nodes, match_array: false)
2.3.0 :005?> puts nodes.inspect
2.3.0 :006?> end
=> :foo
2.3.0 :007 > foo([])
[]
=> nil
2.3.0 :008 > foo([], match_array: true)
[]
~~~
--
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>