From: "David A. Black" Date: 2004-06-12T03:41:31+09:00 Subject: Re: Array#rest 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. David -- David A. Black dblack@wobblini.net