[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Issue: MAPPING-DESTRUCTIVE-INTERACTION (Version 1)
- To: Kent M Pitman <KMP@STONY-BROOK.SCRC.Symbolics.COM>
- Subject: Issue: MAPPING-DESTRUCTIVE-INTERACTION (Version 1)
- From: David A. Moon <Moon@STONY-BROOK.SCRC.Symbolics.COM>
- Date: Fri, 11 Mar 88 13:39 EST
- Cc: CL-Cleanup@SAIL.STANFORD.EDU
- In-reply-to: <880307162443.5.KMP@RIO-DE-JANEIRO.SCRC.Symbolics.COM>
I favor the general idea of MAPPING-DESTRUCTIVE-INTERACTION:EXPLICITLY-VAGUE,
but I have two comments:
Do we want to follow the lead of MAPHASH in explicitly defining that
destructive operations are permissible on the entry currently being
processed? For example, is
(let ((l (list 0 1 2 3 4)))
(dolist (x l)
(when (oddp x)
(setq l (delete x l))))
l)
a valid program that returns (0 2 4)? Note that making this valid
seems to imply a restriction on the implementation of DOLIST, that
it must call CDR before evaluating the body, not after. Personally
I don't care whether this practice is allowed or forbidden. Being
consistent with MAPHASH might lead to a clearer language.
The proposal needs to be expanded to include a complete list of
the functions affected. It also needs a clearer definition of
which destructive operations it covers. For example, I imagine your
intention was to forbid SETF of CDR but to allow SETF of CAR, inside
of DOLIST. However, you didn't say that explicitly. What about
destructive operations on vectors?