Sysop: | Amessyroom |
---|---|
Location: | Fayetteville, NC |
Users: | 28 |
Nodes: | 6 (1 / 5) |
Uptime: | 45:45:53 |
Calls: | 422 |
Calls today: | 1 |
Files: | 1,024 |
Messages: | 90,306 |
Jeff Barnett wrote:
Does the Common Lisp spec say anything about whether the following is
well defined given that the elements of "list" are unique:
(loop for x in list
when (p x)
do (setq list (delete x list)))
See http://www.lispworks.com/documentation/HyperSpec/Body/03_f.htm
But I wouldn't worry too much and just switch to a non-destructive version:
(loop for x in list
unless (p x) collect x into new-list
finally (setq list new-list))