In article <m2vgq3ecsv.fsf / zip.local.thomases.com>, Dave Thomas <Dave / PragmaticProgrammer.com> wrote: >If we've saying that anything that can be indexed is an array, then I >guess we should include files, directories, strings, ... Similarly is >we're saying that anything with keys is a Hash. > >Arrays and hashes have similar properties, but are different beasts, >In the same way that the old OO argument of Squares and Rectangles >can't be resolved by answering a Square is a kind of Rectangle, or a >Rectangle is a kind of Square, so too is it impossible to say that an >Array is a kind of Hash or a Hash a kind of Array. It seems to me that >they just share some properties. Watch out here! The fact that you can consider an array as a special case of a hash, of for that matter a string or a file or a directory as a special case of an array is much more than just an analogy. The set of properties which is shared in these cases is an extremely important programming paradigm, and a language which can express clearly this paradigm in a uniform way in all cases will have a definite advantage. I think the mixins that matju is trying to make can potentially achieve this for Ruby. Best regards, Jean MICHEL