[Q]Ruby LISP-ish stuff

Ask a Question related to Ruby, Design and Development.

  1. #1

    Default Re: [Q]Ruby LISP-ish stuff

    Saluton!

    * Moses Hall; 2003-07-11, 23:45 UTC:
    > def rest
    > self[1,-1] end
    This usually is called 'tail' while self[0] is called 'head'.

    Gis,

    Josef 'Jupp' Schugt
    --
    N'attribuez jamais à la malice ce que l'incompétence explique !
    -- Napoléon

    Josef 'Jupp' Schugt Guest

  2. Similar Questions and Discussions

    1. [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 ...
    2. [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...
    3. 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...
    4. 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...
    5. [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! --...
  3. #2

    Default Re: [Q]Ruby LISP-ish stuff

    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'.
    /\/\oses
    Moses Hall Guest

  4. #3

    Default 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 <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

  5. #4

    Default Re: [Q]Ruby LISP-ish stuff

    Saluton!

    * Ben Giddings; 2003-07-14, 21:07 UTC:
    > > 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?
    Right you are.

    Gis,

    Josef 'Jupp' Schugt
    --
    N'attribuez jamais à la malice ce que l'incompétence explique !
    -- Napoléon

    Josef 'Jupp' Schugt Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139