From: "charliesome (Charlie Somerville)" Date: 2013-08-18T12:06:03+09:00 Subject: [ruby-core:56714] [ruby-trunk - Bug #8801][Rejected] Splatted assignment with Enumerator::Lazy Issue #8801 has been updated by charliesome (Charlie Somerville). Status changed from Open to Rejected This is by design. Normal enumerators also work this way: >> a = [1,2,3].each => # >> b, *c = a => # >> b => # >> c => [] Arrays are the only type of object that will unpack themselves when used with splatted assignment like this. If you splat the right hand side as well, this will force the Enumerator::Lazy to an array and the assignment will work as you expect it: >> a = [1,2,3].lazy => # >> b, *c = *a => [1, 2, 3] >> b => 1 >> c => [2, 3] ---------------------------------------- Bug #8801: Splatted assignment with Enumerator::Lazy https://bugs.ruby-lang.org/issues/8801#change-41241 Author: benmoss (Ben Moss) Status: Rejected Priority: Normal Assignee: Category: Target version: ruby -v: ruby 2.1.0dev (2013-08-18) [x86_64-darwin11.4.2] Backport: 1.9.3: UNKNOWN, 2.0.0: UNKNOWN Actual: >> a = [1,2,3].lazy => # >> b, *c = a => # >> b => # >> c => [] Expected: >> a = [1,2,3].lazy => # >> b, *c = a => # >> b => 1 >> c => [2, 3] Basically, I expect a lazy array to act like a non-lazy one, and that using a destructuring assignment like this is basically the same as calling #take(1) and #drop(1). -- http://bugs.ruby-lang.org/