In clojure you can trivially use your own cons cells and get equality for free, in common lisp you can't build the proper mathematical properties without essentially reinventing clojure.
Substantiate your claims.
(defparameter my-hash (make-hash-table))
(defparameter thy-hash (make-hash-table))
(setf (gethash 'one-entry my-hash) "one")
(setf (gethash 'one-entry thy-hash) "one")
(print (equal my-hash thy-hash))
NIL
while in clojure every immutable datastructure you encounter in the std-lib or syntax has proper equality.
(= {'one-entry "one"} {'one-entry "one"})
true
To which McCarty had to say:
> I considered it important to make these expressions obey the usual mathematical laws allowing replacement of expressions by expressions giving the same value.
This is the TXR Lisp interactive listener of TXR 236.
Quit with :quit or Ctrl-D on empty line. Ctrl-X ? for cheatsheet.
1> (defparm my (hash))
my
2> (defparm thy (hash))
thy
3> (set [my 'one-entry] "one")
"one"
4> (set [thy 'one-entry] "one")
"one"
5> (equal my thy)
t
6> (set [thy 'two-entry] "two")
"two"
7> (equal my thy)
nil
Or, briefly: 7> (equal #H(() (a b)) #H(() (a b)))
t
8> (equal #H(() (a b)) #H(() (a c)))
nil
Also this: [1]> (equal '(1 2) '(1 2))
T
[2]> (equal '(1 2) '(1 2.0))
NIL
[3]> (equal #(1 2) #(1 2)) ;; oops, WTF?
NIL
[4]>
1> (equal '(1 2) '(1 2))
t
2> (equal '(1 2) '(1 2.0))
nil
3> (equal #(1 2) #(1 2))
t
4> (equal #(1 2) #(1 2.0))
nilThe (equal '(1 2) '(1 2.0)) is really a tricky one.
Clojure also fails the (= 1 1.0) test. But I'm really not sure if that's a bad thing. I mean (= [1] #{1}) (an ordered vector and an unordered set) is also false, so it kinda makes sense to argue that distinct types are always distinct. However in clojure (= '(1) [1]) which I find a lot harder to defend It's caused by an automatic conversion to sequences which are then compared, and I think I might even add that one to the "warts" list.
I didn't know that having leaky abstractions on top of the horrible Java standard lib was "being closer to math"
> Anyway, I decided to write a paper describing LISP both as a programming language and as a formalism for doing recursive function theory.
> One mathematical consideration that influenced LISP was to express programs as applicative expressions built up from variables and constants using functions. I considered it important to make these expressions obey the usual mathematical laws allowing replacement of expressions by expressions giving the same value. The motive was to allow proofs of properties of programs using ordinary mathematical methods. This is only possible to the extent that side-effects can be avoided. Unfortunately, side-effects are often a great convenience when computational efficiency is important, and ``functions'' with side-effects are present in LISP.
From http://www-formal.stanford.edu/jmc/history/lisp/node3.html#S...
Tbh it seems pointless discussing this with you because the idea of common lisp being the embodyment of the lisp philosophy seems to have become personal to you. Sorry my energy reservoirs are drained, I'm just gonna ignore your posts, and head back to work, there's a large CL codebase that needs to be rewritten to clojure and that's stressful enough.
Sure, the paper was more a side-effect of their work on LISP 1 and the mathematical ideas were developed at the end of the first phase of the development & implementation of LISP.
> He talks about how it was meant as an alternative to the computational models based on turing machines in addition to a symbolic computation tool for AI and therefore used side effects for convenience but also tried to keep mathematical properties, like referential transparency.
The programming language LISP 1 had SET, SETQ, control flow via GOTO, setting of slots of cons cells, destructive operations for list processing, destructive property list operations, ...
LISP was an actual programming system for a real computer, their IBM 704. It was a LISP implementation written in assembler and LISP with stuff like an interpreter, a compiler, garbage collection, input/output, a kind of read-eval-print-loop, saving memory dumps and loading them, writing/loading assembler code from LISP, and all that stuff which is in a typical LISP implementation since then.
The chapter you linked to even has the title 'The implementation of LISP'.
Check out the LISP 1 manual I linked to sometime.