Re: Question about loop
- From: Pascal Costanza <pc@xxxxxxxxx>
- Date: Thu, 31 May 2007 08:29:50 +0200
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))
Pascal
--
My website: http://p-cos.net
Common Lisp Document Repository: http://cdr.eurolisp.org
Closer to MOP & ContextL: http://common-lisp.net/project/closer/
.
- References:
- Question about loop
- From: Jeff Barnett
- Question about loop
- Prev by Date: Seattle in 2 weeks: Lisp and Symbolic Programming From the Beginning
- Next by Date: Re: Break Statements similar to C or C++
- Previous by thread: Question about loop
- Next by thread: Re: Question about loop
- Index(es):
Relevant Pages
|