From: Josef 'Jupp' Schugt Date: 2003-07-15T04:11:25+09:00 Subject: Re: [Q]Ruby LISP-ish stuff Saluton! * Moses Hall; 2003-07-14, 12:23 UTC: > Ah, these are the "car/cdr" or "first/rest" synonyms from Haskell? > > >> def rest > >> self[1,-1] end > > > > This usually is called 'tail' while self[0] is called 'head'. 'head' and 'tail' seems to be quite generic terms - they occur in a large number of texts that describe dealing with lists. The only notable issue is that 'tail' seems to have different meanings depending on the lanugage in common. As far as languages that do not have native list support are concerned it means 'the last element' while in those languages that have a list data type it means 'anything but the last element'. The former version e.g. can be found in 'Introduction to Algorithms' by Cormen, Leiserson and Rivest or 'Algorithms in ' by Sedgwick. Anyway. In my opinion 'list[1,-1]' is much more telling than 'rest' because 'rest' means 'remainder after doing something' whereas 'list[1,-1]' specifies that 'doing something'. Gis, Josef 'Jupp' Schugt -- N'attribuez jamais � la malice ce que l'incomp�tence explique ! -- Napol�on