Ask a Question related to Ruby, Design and Development.
-
Josef 'Jupp' Schugt #1
Re: [Q]Ruby LISP-ish stuff
Saluton!
* Moses Hall; 2003-07-11, 23:45 UTC:This usually is called 'tail' while self[0] is called 'head'.> def rest
> self[1,-1] end
Gis,
Josef 'Jupp' Schugt
--
N'attribuez jamais à la malice ce que l'incompétence explique !
-- Napoléon
Josef 'Jupp' Schugt Guest
-
[ANN] ruby-lisp-0.1
ruby-lisp-0.1 is Released! ========================== I have just released the ruby-lisp module to the world. Check it out at ... -
[ba-rb] BA-rb ( Bay Area Ruby Users Group ) - 'Generating Code in Ruby' by Jack Herrington.
Count me in again, too. -- Jos Backus _/ _/_/_/ Sunnyvale, CA _/ _/ _/ _/ _/_/_/ _/ _/ _/ _/ jos at... -
BA-rb ( Bay Area Ruby Users Group ) - 'Generating Code in Ruby' by Jack Herrington.
BA-rb (Bay Area Ruby language Users Group) is pleased to announce that it will begin meeting again. The topic for the first meeting will be a... -
Python syntax in Lisp and Scheme
Rene van Bevern <rvb@rvb.dyndns.org> wrote in message news:<slrnbnr2pu.1qe.rvb@negoyl.vb-network>... I can't remember how *exactly* I came to... -
[ANN] ruby-freedb, ruby-serialport, ruby-mp3info moved to Rubyforge
http://ruby-freedb.rubyforge.org/ http://ruby-serialport.rubyforge.org/ http://ruby-mp3info.rubyforge.org/ bye! --... -
Moses Hall #2
Re: [Q]Ruby LISP-ish stuff
Ah, these are the "car/cdr" or "first/rest" synonyms from Haskell?
/\/\oses>>> def rest
>> self[1,-1] end
> This usually is called 'tail' while self[0] is called 'head'.
Moses Hall Guest
-
Josef 'Jupp' Schugt #3
Re: [Q]Ruby LISP-ish stuff
Saluton!
* Moses Hall; 2003-07-14, 12:23 UTC:'head' and 'tail' seems to be quite generic terms - they occur in a> 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'.
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 <insert language>'
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
Josef 'Jupp' Schugt Guest
-
Josef 'Jupp' Schugt #4
Re: [Q]Ruby LISP-ish stuff
Saluton!
* Ben Giddings; 2003-07-14, 21:07 UTC:Right you are.>> > 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'.
> Er, that's anything but the *first* element, right?
Gis,
Josef 'Jupp' Schugt
--
N'attribuez jamais à la malice ce que l'incompétence explique !
-- Napoléon
Josef 'Jupp' Schugt Guest



Reply With Quote

