Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!seismo!gatech!bloom-beacon!husc6!cca!jack From: jack@cca.CCA.COM (Jack Orenstein) Newsgroups: comp.lang.lisp Subject: cdr encoding (was Re: Importance of REPLACA, REPLACD) Message-ID: <17815@cca.CCA.COM> Date: Fri, 17-Jul-87 15:23:39 EDT Article-I.D.: cca.17815 Posted: Fri Jul 17 15:23:39 1987 Date-Received: Sat, 18-Jul-87 15:08:23 EDT References: <22@citcom.UUCP> <6900008@iaoobelix.UUCP> <19747@ucbvax.BERKELEY.EDU> Reply-To: jack@CCA.CCA.COM.UUCP (Jack Orenstein) Organization: Computer Corp. of America, Cambridge, MA Lines: 20 In article <19747@ucbvax.BERKELEY.EDU> larus@paris.Berkeley.EDU(James Larus) writes: >Luddy Harrison ... has done some very nice work on >using vector-like structures to store lists. ... >Certain common operations, such as APPEND, become very fast and efficient. >It's main disadvantage is that RPLACA and RPLACD are outlawed because they >screw up the structure-sharing. ... I can see why RPLACD causes trouble, but why RPLACA? Suppose that P is a pointer to a "cell" in the middle of some list represented by a vector. P actually points to the location of the car (i.e. one of the vector components). (RPLACD P ...) won't work because the cdr field is at the next location in physical memory. (RPLACA P ...) just updates the contents of the vector component. If C is an ordinary cell, then I don't see why (RPLACA C P) or (RPLACD C P) would cause any trouble. Am I missing something? Jack Orenstein