From: "mame (Yusuke Endoh)" Date: 2012-05-17T00:30:54+09:00 Subject: [ruby-core:45088] [ruby-trunk - Feature #6414][Assigned] Destructuring Assignment Issue #6414 has been updated by mame (Yusuke Endoh). Status changed from Open to Assigned Assignee set to matz (Yukihiro Matsumoto) FYI: There is similar (but not same) proposal: [ruby-core:41772] -- Yusuke Endoh ---------------------------------------- Feature #6414: Destructuring Assignment https://bugs.ruby-lang.org/issues/6414#change-26661 Author: edtsech (Edward Tsech) Status: Assigned Priority: Normal Assignee: matz (Yukihiro Matsumoto) Category: Target version: I mean: john = {name: "John", last: "Smith"} {name, last} = john # extract value by key from the hash and set to local variable with same name name # => "John" last # -> "Smith" Useful for ex. for "options" hashes: def select(options={}) {only, except} = options ... end As extra part of this feature can be hash constructing in this way: name = "John" last = "Smith" find({name, last}) # equals to => find({name: "John", last: "Smith"}) I think both really nice to have in Ruby. Thanks. -- http://bugs.ruby-lang.org/