>Hi, all, > >I tried looking for a linked list implementation on RAA and searched for >"linked list" on the ruby-talk archive and was surprised to see the only >instance was matz's LISP-like version. That didn't turn out to be quite right >for my purposes, so I'm writing one from scratch (and, not being formally >trained in CS, I'm stumbling my way through it with the help of a data >structures book). I'm starting to get frustrated at hunting down the little >bugs in my implementation that are preventing me from moving forward with the >rest of my project, so if anyone has a reasonably robust linked list class in >their stash, I exhort you to post it. Thanks! > > >Al > >===== >Albert Davidson Chou > > Get answers to Mac questions at http://www.mac-mgrs.org/ . Hi Why not just use an Array. It has almost all of the functions you would expect from a linked list, eg push, pop etc. The only thing missing is car and cdr or head and tail but you can extend Array with those class Array def head return self[0] end def tail return self[1..self.length] end end With regards, Johan Dahl -- Johan Dahl, Research Engineer Department of Linguistics and Phonetics, Lund University Address: Helgonabacken 12, 223 62 Lund, SWEDEN Tel: +46-(0)46-2228443 Fax: +46-(0)46-2224210 E-mail: mailto:Johan.Dahl / ling.lu.se WWW: http://www.ling.lu.se/persons/Johan/