Re: [sawfish] Re: The dark corners of rep



On May 18, Teika Kazura wrote:
> Hi, Eli Barzilay. I've added the pointer in the wiki to your post,
> under the section "How can I learn rep? How does it differ from
> other lisps?": http://sawfish.wikia.com/wiki/Librep

Heh, I didn't think that this would end up being a reference to learn
about rep...


> Last Sep, Timo & Helmut Eller gave some descriptions, and yours adds
> to them. Thanks.
> # And everyone, please write. Any helps.
> 
> I only know elisp, and once used setcar / setcdr, and I suffered.
> Rep uses rplaca / rplacd. It seems common lisp way.

`rplaca' and `rplacd' are ancient names, this is from CLtL:

  The functions rplaca and rplacd go back to the earliest origins of
  Lisp, along with car, cdr, and cons.  Nowadays, however, they seem
  to be falling by the wayside.  More and more Common Lisp programmers
  use setf for nearly all structure modifications: (rplaca x y) is
  rendered as (setf (car x) y) or perhaps as (setf (first x) y).  Even
  more likely is that a defstruct structure or a CLOS class is used in
  place of a list, if the data structure is at all complicated; in
  this case setf is used with a slot accessor.

In any case, that's another rep difference from Scheme -- it provides
both `rplaca'/`rplacd' and `setcar'/`setcdr' -- the difference seems
to be the return value.  (Using such mutation is a bad idea anyway,
and using the result of a side-effect function is also a bad idea.)

-- 
          ((lambda (x) (x x)) (lambda (x) (x x)))          Eli Barzilay:
                  http://www.barzilay.org/                 Maze is Life!


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]