Actions
Bug #9749
closedr45589 introduced an incompatibility
Description
$ ruby -ve 'ary = []; (1..10).each_slice(3, &lambda {|a, *| ary << a }); p ary'
ruby 2.1.0p0 (2013-12-25 revision 44422) [x86_64-linux]
[[1, 2, 3], [4, 5, 6], [7, 8, 9], [10]]
$ ./miniruby -ve 'ary = []; (1..10).each_slice(3, &lambda {|a, *| ary << a }); p ary'
ruby 2.2.0dev (2014-04-16 trunk 45599) [x86_64-linux]
[[10], [10], [10], [10]]
See also: https://github.com/ruby/ruby/pull/596#issuecomment-40594384
--
Yusuke Endoh mame@tsg.ne.jp
Updated by nobu (Nobuyoshi Nakada) over 10 years ago
- Status changed from Open to Closed
- % Done changed from 0 to 100
Applied in changeset r45603.
enum.c: fix condition to recycle block argument
- enum.c (dont_recycle_block_arg): fix condition to recycle block
argument. lambda with rest can get internal array directly.
[ruby-core:62060] [Bug #9749]
Updated by usa (Usaku NAKAMURA) over 10 years ago
- Backport changed from 2.0.0: UNKNOWN, 2.1: UNKNOWN to 2.0.0: DONTNEED, 2.1: DONTNEED
Actions
Like0
Like0Like0