[Openmcl-devel] (equal '#:G34159 '#:G34159) -> NIL

Pascal J. Bourguignon pjb at informatimago.com
Wed Aug 1 13:56:38 PDT 2012


Taoufik Dachraoui <dachraoui.taoufik at gmail.com> writes:

> Hi
>
> this is what happened:
>
> (defun f (lst) (equal (first lst) (second lst)))
> (defun g () (let ((x (gensym))) `(,x ,x)))
>
> ? (g)
> (#:G34410 #:G34410)
> ? (f '(#:G34410 #:G34410))
> NIL
> ? (f (g))
> T
>
> I had the tendancy to think that everything that have the same printed
> form are equal; But can  someone explain why this is not so ?  (as
> shown above and in the example by Jason below)
>
> I may understand the following but I am not sure (need an expert
> explanation)
>
> ? (equal #(1 2 3) #(1 2 3))
> NIL

Just read the specification.  clhs eql, clhs equal, clhs equalp

Also, read the specification about the dispatching reader macro #:.

-- 
__Pascal Bourguignon__                     http://www.informatimago.com/
A bad day in () is better than a good day in {}.




More information about the Openmcl-devel mailing list