Page 1 of 1

(replace nil list-of-nil) hangs

Posted: Mon May 18, 2009 12:32 am
by hs
> (set 'a '( 1 2))
(1 2)
> (replace 1 a)
(2)
> a
(2)
> (replace 2 a)
()
> a
()
> (set 'a '(true true))
(true true)
> (replace true a)
()
> (set 'a '(nil nil))
(nil nil)
> (replace nil a) ;hangs

Posted: Mon May 18, 2009 2:23 am
by Lutz
Thanks for this discovery, it happens when all elements are 'nil'. As a work-around use 'clean' instead of 'replace':

Code: Select all

> (set 'a '(nil nil))
(nil nil)
> (clean nil? a)
()
>