From: Robert Klemme Date: 2004-06-12T04:08:40+09:00 Subject: Re: Array#rest "David A. Black" schrieb im Newsbeitrag news:Pine.LNX.4.44.0406111136400.19371-100000@wobblini... > Hi -- > > On Fri, 11 Jun 2004, Patrick Gundlach wrote: > > > Hello David, > > > > >> then we can even define Array#cadr and so on ;-) > > > > > > What problem would this solve? > > > > $USERDEFINED problem. In Lisp there are car, cdr and often(?) cddr > > cadr,... which access members of lists (cadr acesses the second > > element, cddr the third, fourth .... element). Absolutely no need to > > put this into ruby itself though. Its more a mnemonic and shorter to > > type. Example (setq mylist '((1 a))) then (car (cdr 'mylist)) is the > > same as (caar 'mylist) which is 1. > > I know about it from Lisp, just wondering how/whether it would enhance > Ruby. I can see 'rest' as a companion to 'first' and 'last', but > going down the road of car, cdr and friends seems like a language > pastiche. Sounds like a good suggestion for an RAA project "rlisp" to make lispers feel at home with Ruby. :-) robert