[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: REMF-DESTRUCTION-UNSPECIFIED (Version 2)
- To: CL-Cleanup@SAIL.STANFORD.EDU
- Subject: Re: REMF-DESTRUCTION-UNSPECIFIED (Version 2)
- From: Masinter.pa@Xerox.COM
- Date: 11 Nov 87 01:49 PST
- In-reply-to: various
I'm not sure where we stand as a group on this issue.
I'll first say that I think the Cleanup committee is not an unreasonable
place to raise issues which might be construed as changing the goals of
Common Lisp. It also seems that X3J13 cannot really deal with general
issues without having some specific examples to deal with, and
REMF-DESTRUCTURING-UNSPECIFIED is a useful precedent.
You may recall the rather painful and lengthy debate on the charter
statement at an early X3J13 meeting, which was trying to get down the
exact wording of what we were trying to do here. Portability was
certainly one of the priorities, and performance of CL implementations
wasn't mentioned.
I'll summarize my position on various issues. A cell is "destroyed" if
its CAR and/or CDR are setf-d to unspecified values.
The following is my opinion; it is somewhere in between
MAKE-EXPLICITLY-VAGUE and MAKE-EXPLICITLY-DEFINED. I think it is
consistent (i.e., no less vague) than CLtL but allows for the
performance advantages that DLA claimed was the primary motivation for
the original proposal. (I reject the "bad programming practice to rely
on" argument; we can establish programming practice by saying what is
good and bad practice. It is bad programming language design to attempt
to disallow bad programs by making them non-portable.
(SETF (GETF place indicator) value)
is permitted to SETF the CADR of what
(GET-PROPERTIES place (LIST indicator)) would return
(if non-null) or to SETF place.
(REMF place indicator)
is permitted to either SETF place or to SETF the CDR of the
part of the top-level list in place which points to what
(GET-PROPERTIES place (LIST indicator)) would return.
In addition, the cells removed may be "destroyed".
(SETF (GET symbol indicator) value)
behaves exactly the same as
(SETF (GETF (SYMBOL-PLIST symbol) indicator) value).
(REMPROP symbol indicator)
behaves exactly the same as
(REMF (SYMBOL-PLIST symbol) indicator).
(NREVERSE sequence), (DELETE object sequence ...), (DELETE-IF test
sequence ...), (DELETE-IF-NOT test sequence ...), (DELETE-DUPLICATES
sequence ...), (NSUBSTITUTE new-object old-object sequence ...),
(NSUBSTITUTE-IF new-object test sequence ...), (NSUBSTITUTE-IF-NOT
new-object test sequence ...)
when sequence is a list may "destroy" sequence
(NCONC . lists)
is defined such that (NCONC x y) == (if (null x) y (progn (setf (cdr
(last x)) y) x))
(NRECONC list tail)
may "destroy" list.
(NBUTLAST list ...)
is permitted to SETF the tail of its argument list whose CDR is ...
(NSUBST new-object old-object tree)
(NSUBST-IF new-object test tree)
(NSUBST-IF-NOT new-object test tree)
is only permitted to SETF any part of the TREE of conses which must
be replaced by NEW-OBJECT.
(NUNION list1 list2 ...)
(NINTERSECTION list1 list2 ...)
(NSET-EXCLUSIVE-OR list1 list2 ...)
all but the last argument may be destroyed.