unique and sort misbehave given list containing nil

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

unique and sort misbehave given list containing nil

Post by hs »

newLISP v.10.0.2 on Linux IPv4 UTF-8, execute 'newlisp -h' for more info.

> (set 'q '("m4" "08" nil "rs" "vr" "vt" "m4"))
("m4" "08" nil "rs" "vr" "vt" "m4")
> (unique q)
("m4" "08" nil "rs" "vr" "vt" "m4") ;note "m4" appears twice
> (sort q)
("08" "m4" nil "m4" "rs" "vr" "vt") ;note "m4" nil "m4"
> (replace nil q)
("08" "m4" "m4" "rs" "vr" "vt")
> (unique q)
("08" "m4" "rs" "vr" "vt")

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

Post by Lutz »

'nil' and 'true' confuse the sort order (also used in 'unique'), thanks for catching this.



ps: this is fixed in the upcoming 10.0.3 development release

Post Reply