From: ts Date: 2001-04-19T22:52:36+09:00 Subject: [ruby-talk:13865] Re: use strict + nested data structures in Ruby >>>>> "M" == Marko Schulz writes: M> But this could be solved by an educated guess: If an object of a M> subclass of Integer is used, create an array, otherwise a hash. You can't do this. Just an example, for bdb you have 2 classes BDB::Recno hash like but indexed by Integer. It *really* work like an Hash, because when you delete a key, Berkeley DB don't renumber the keys. BDB::Recnum array like (indexed by Integer). In this case (with a special flag when you open the file) Berkeley DB renumber the keys when you delete a key, This mean that it *really* work like an Array ruby give me the possibility to have these 2 interfaces because I can write bdb = {} bdb[0] = 'a' bdb = [] bdb[0] = 'a' Guy Decoux