(replace nil list-of-nil) hangs

Notices and updates
Post Reply
hs
Posts: 13
Joined: Sun Sep 03, 2006 8:32 am

(replace nil list-of-nil) hangs

Post 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

Lutz
Posts: 5279
Joined: Thu Sep 26, 2002 4:45 pm
Location: Pasadena, California
Contact:

Post 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)
()
> 

Post Reply