unique and sort misbehave given list containing nil

Started by hs, March 24, 2009, 08:58:30 AM

Previous topic - Next topic

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

#1
'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