Was joking yesterday about `==` vs `===` in javascript and remembered that common #lisp, never to be outdone, has four (!!) equality functions: `eq`, `eql`, `equal`, and `equalp`.
I always get them mixed up so I'm going to infodump about them while I still remember the difference 🧵
I always get them mixed up so I'm going to infodump about them while I still remember the difference 🧵
Comments
Note: this means that primitive values (ints, chars) are usually not `eq`!
For example: `(eql 3 3)` is true, but `(eql 3 3.0)` is false.
E.g.:
`(equal (cons 'a 'b) (cons 'a 'b))` is true
`(equal (cons 'a 'b) (cons 'a 'c))` is false
Note that `equal` value equality is still constrained by type in the same way as `eql`.