2 ms·
Clojure doesn't have this problem, in Clojure nil is not the empty list, and the empty list is not nil. ;; Nil and empty list are different (nil? '())
by didibus 5y ago
Clojure doesn't have this problem, in Clojure nil is not the empty list, and the empty list is not nil.
;; Nil and empty list are different
(nil? '())
;> false
;; Empty list is not falsy
(if '() true false)
;> true
;; Only nil is falsy
(if nil true false)
;> false
;; Prints as empty list
(pr '())
;> ()
- brundolf 5y agoGood decision on their part. Unfortunately ours was CL-inspired