3 ms·
put it into a file, compile it, load it, run it: /tmp % more test.lisp (print (list :eq-or-not (eq '(a b) '(a b)))) /tmp % sbcl This is SBCL 2.1.9, a
by lispm 5y ago
put it into a file, compile it, load it, run it:
/tmp % more test.lisp
(print (list :eq-or-not (eq '(a b) '(a b))))
/tmp % sbcl
This is SBCL 2.1.9, an implementation of ANSI Common Lisp.
More information about SBCL is available at <http://www.sbcl.org/>.
SBCL is free software, provided as is, with absolutely no warranty.
It is mostly in the public domain; some portions are provided under
BSD-style licenses. See the CREDITS and COPYING files in the
distribution for more information.
* (load (compile-file "test.lisp"))
; compiling file "/private/tmp/test.lisp" (written 03 JAN 2022 07:58:54 PM):
; processing (PRINT (LIST :EQ-OR-NOT ...))
; wrote /private/tmp/test.fasl
; compilation finished in 0:00:00.003
(:EQ-OR-NOT T)
T
- dreamcompiler 5y agoExcellent example of a place where the file compiler can differ from the REPL, and as you point out this is perfectly legal. It's why #'eq is often not the best equality predicate unless you know what you're doing. CCL and Lispworks return NIL for this test in both cases.