Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Path: utzoo!mnetor!uunet!seismo!columbia!rutgers!sri-spam!mordor!lll-tis!ptsfa!ihnp4!inuxc!iuvax!pur-ee!uiucdcs!uxc.cso.uiuc.edu!uicsrd!harrison
From: harrison@uicsrd.csrd.uiuc.edu
Newsgroups: comp.lang.lisp
Subject: Re: cdr encoding (was Re: Importanc
Message-ID: <47400017@uicsrd>
Date: Mon, 20-Jul-87 17:32:00 EDT
Article-I.D.: uicsrd.47400017
Posted: Mon Jul 20 17:32:00 1987
Date-Received: Fri, 24-Jul-87 04:09:37 EDT
References: <8052@labrea.STANFORD.EDU>
Lines: 41
Nf-ID: #R:labrea.STANFORD.EDU:8052:uicsrd:47400017:000:1775
Nf-From: uicsrd.csrd.uiuc.edu!harrison    Jul 20 16:32:00 1987


>/* Written  4:13 pm  Jul 18, 1987 by weening@Gang-of-Four.Stanford.EDU in uicsrd:comp.lang.lisp */
>
>I tend to disagree with the first part of this, at least in the case
>of a single-process program (or a list structure known to be accessed
>by only a single process).  In this case, I think techniques such as
>developed in [2] can be used to adequately define the semantics, and
>there may be cases where RPLACA is of some use.
>
>Of course, if you want RPLACA to have the exact same semantics as with a
>conventional pointer-based list representation, there will be problems.
>But I suspect that this is rarely needed.
>
>						Joe Weening

It feels odd to argue *against* possible uses for this representation;
nevertheless, here is a pathological use of RPLACA, to illustrate the
problem:

        ...
        (SET! X '(A B C D E))
        (IF CONDITION1 (SET! S (APPEND X R))
        (SET! Y (APPEND X X))
        (RPLACA X 'OOPS)
        ...

If CONDITION1 is true (and R non-null), then after this sequence,
Y = (A B C D E OOPS B C D E); else, Y = (OOPS B C D E OOPS B C D E).
(Y will consist of 5 cells, and will have a length of 10.)
In short, in the presence of RPLACA and RPLACD, APPEND appears to have
side-effects, and RPLACA appears to affect two elements of a 
non-circular list.  Note also that the garbage collector affects sharing:
after S and Y are reclaimed, APPENDing to X may again result in sharing with X.

Probably one could make a rule such as "(RPLACA X Y) is undefined
if the cell X has ever been involved in an APPEND operation;" this may
be the sort of alteration to the semantics that Joe has in mind.
As was mentioned before, omitting the RPLAC operations is, for us, part of
a strategy of parallelization and compilation.

-Luddy Harrison