(def include? (thing things) ; alias for 'detect ; true if thing is in things, nil otherwise (detect thing things)) (def sort-by (f things) ; sort 'things according to the value ; returned by 'f for each thing in 'things (let tmp (hash) (each thing things (hash-cons tmp (f thing) thing)) (apply joinlists (map λx(hash-get tmp x) (sort:hash-keys tmp)))))