From: Suraj Kurapati Date: 2010-04-13T09:03:50+09:00 Subject: [ruby-core:29484] [Feature #3131] add Kernel#Hash() method like Kernel#Array() Issue #3131 has been updated by Suraj Kurapati. Hi, matz wrote: > since conversion from arrays only meaningful for specific case > (array of 2-element arrays), I am not sure whether Hash() should > support conversion from Array in general or not. Hash::[] does not support conversion from odd-length Array (because it is uncertain what Ruby must do with the 2n+1'th element) and will raise an error in such case. So, in my view, Kernel#Hash() need not support conversion from odd-length Array either. If you wish to avoid even-length Array conversion in Kernel#Hash() because odd-length Array conversion is not supported, then I request that Kernel#Hash() must still support conversion from empty Array because Kernel#Array() already supports conversion from empty Hash: >> Array({}) => [] In summary, I request that Kernel#Hash() supports conversion from: * nil * Hash * empty Array It would be nice if Kernel#Hash() also supports conversion from: * even-length Array Thanks for your consideration. ---------------------------------------- http://redmine.ruby-lang.org/issues/show/3131 ---------------------------------------- http://redmine.ruby-lang.org