From: Pierre Vachon
Subject: Pointers in Lisp (again...)
Date: 
Message-ID: <vachon.733628816@matane>
Different question, same subject...

Is there a way to tell Lisp to return the _address_ of something �I'm
referencing instead of the actual value? This is done automatically for
arrays, for example:

LISP> (setf array (make-array...�))
#<Array 0x24E5A23>

LISP> (setf other array)
#<Array 0x24E5A23>

A change to 'other' will also change 'array'... and I would like to do
the same with this:

LISP> (setf a '(0 1 2 3 4 5))
(0 1 2 3 4 5)

LISP> (special-setf temp (cdr a))
#<Address 0xD43E234>

LISP> (setf temp 'changed)
CHANGED

LISP> a
(0 CHANGED)

Why do I need this? Well, I've done a whole project with a
non-pointer structure, saving processing time and memory, but the
_very last part_ (of course...) involves changing many values in very
large & deeply nested lists DEPENDING ON WHAT'S ALREADY THERE. I'm
looking for a way to cut CPU time by not having to "destructure" the list
twice: once for testing, once for setting (if necessary..).

Thanks in advance!

Pierre.
From: Simon Spero
Subject: Re: Pointers in Lisp (again...)
Date: 
Message-ID: <1993Apr1.030550.28212@samba.oit.unc.edu>
In article <················@matane> ······@gel.ulaval.ca (Pierre Vachon) writes:
>LISP> (special-setf temp (cdr a))
>#<Address 0xD43E234>
>
>LISP> (setf temp 'changed)
>CHANGED
>
>LISP> a
>(0 CHANGED)
>
>Why do I need this? Well, I've done a whole project with a
>non-pointer structure, saving processing time and memory, but the
>_very last part_ (of course...) involves changing many values in very

Clue: what is the 'normal' implementation of a cons? What happens if you
set a and b to point to a cons cell, and do a rplaca on the cons?

Simon
-- 
Hackers Local 42- National Union of Computer Operatives, Chapel Hill section
------------------------------------------------------------------------------
"Arise you users of compression, though the   | WAIS/Z39.50 spoken here
tarfiles hold you down" - The Internetworkale | DoD #612 | Tel: +1-919-962-9107