Sorting nil and true

Started by cameyo, June 16, 2020, 02:10:39 AM

Previous topic - Next topic

cameyo

How to sort a list containing nil and true symbols?
(setq a '(nil true b a))
(sort a)
;-> (nil true a b)

Thanks

cameyo

#1
I have found this method:
(setq lst '(true nil true b a))
(map sym (sort (map string lst)))
;-> (a b nil true true)

cameyo