newLISP Fan Club

Forum => newLISP newS => Topic started by: hs on March 24, 2009, 08:58:30 AM

Title: unique and sort misbehave given list containing nil
Post by: hs on March 24, 2009, 08:58:30 AM
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")
Title:
Post by: Lutz on March 24, 2009, 09:31:52 AM
'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