I've noticed in Scheme, Racket, and Clojure that the expression (using Clojure here) (and true '())
evaluates to ()
, and (and '() true)
evaluates to true
. This is true not only for the empty list, but for any list.
But in GNU CLISP and Emacs Lisp, (and t '())
evaluates to nil
and (and '() t)
evaluates to nil
also, but (and t '(1 2 3))
evaluates to (1 2 3)
and (and '(1 2 3) t)
evaluates to t
.
What is going on here?
(null? '())
is true. In Clojure,(nil? '())
is indeed false. – Eccentricity