From: Dave Thomas Date: 2000-11-28T07:29:52+09:00 Subject: [ruby-talk:6594] Re: best way to interleaf arrays? David Alan Black writes: > What about a to_h method for arrays? I mention this mainly for the > sake of symmetry with other to_* methods. Then again, such a method > may violate some principle of design: it does seem slightly wrong for > Array to "know" how to generate a hash (whereas not strange for Hash > to know how to create itself from an array). That was my thinking (if you can call it that ;-) It seems reasonable for a more complex class to know about a more primitive one, but not the other way around. An alternative might be Kernel::Hash, along the lines of Kernel::Integer, which does the business depending on the type of its argument. Regards Dave