Hi,

i had an idea of a cyclic list. It came to my mind months ago and the
implementation in ruby was so simple:

class RoundList < Array
  def initialize(size)
    @@size = size
  end
  def add(k,v)
    self[k%@@size] = v
  end
  def get(i)
    self[i%@@size]
  end
end
# r = RoundList.new(3)
# => []
# r.add(1,"eins")
# => "eins"
# r
# => [nil, "eins"]
# r.add(0,r)
# => [[...], "eins"]
# r.add(2,r)
# => [[...], "eins", [...]]
# r.get(0)
# => [[...], "eins", [...]]
# r.get(0).get(0)
# => [[...], "eins", [...]]
# r.get(0).get(0).get(2)
# => [[...], "eins", [...]]

when I saw this, i had a weird feeling of complexity. Mixing different
RoundLists, fasten them with knots, creating some kind loop-structure and all
this seems to be endless because r.get(0).get(0) ==  r.get(0).get(0).get(0) ... 
I couldn't and cannot imagine, how this construction can be usefull.

If anyone of you CAN imagine, please let me know.

best regards
ralf


-- 
>  "not using Ruby is punishment enough"
>   -- James Britt, 8.5.2005, ruby-talk / ruby-lang.org