[cl-store-devel] cl-clone ?

Chris Dean ctdean at sokitomi.com
Sun Jan 21 19:50:56 UTC 2007


Kilian Sprotte <ml13 at onlinehome.de> writes:
> Of course a deep equal can be done as well and probably some other
> things...

I have some internal code that I use to do deep equal and deep hash.
The difficulty comes in walking complex objects in a portable way,
which is easy for me since I'm all LispWorks all the time.

    (defgeneric object-equal? (a b))

    (defmethod object-equal? ((a null) (b null))
      t)

    (defmethod object-equal? ((a symbol) (b symbol))
      (eq a b))

    (defmethod object-equal? ((a number) (b number))
      (= a b))

    ;; etc ..

The object-hash method is similar.

Cheers,
Chris Dean




More information about the cl-store-devel mailing list