3 ms·
$ sbcl This is SBCL 1.5.8.138-d53fb0eb3, an implementation of ANSI Common Lisp. More information about SBCL is available at <http://www.sbcl.org/>. * (e
by dreamcompiler 5y ago
$ sbcl
This is SBCL 1.5.8.138-d53fb0eb3, an implementation of ANSI Common Lisp.
More information about SBCL is available at <http://www.sbcl.org/>.
* (eq '(a b) '(a b))
NIL
*
Which is exactly what I'd expect in any normal (non-weird) Common Lisp implementation. Is your SBCL returning T for this?
- lispm 5y agoput 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.
- deleted 5y ago[deleted]