[Openmcl-devel] Eq definition

Gary Byers gb at clozure.com
Tue Mar 2 21:40:41 UTC 2010



On Tue, 2 Mar 2010, Mathieu Suen wrote:

> Hi,
>
> I read the source code of the eq function and find it quite odd:
>
> (defun eq (x y)
>  "Return T if OBJ1 and OBJ2 are the same object, otherwise NIL."
>  (eq x y))
> ;; /level-0/l0-pred.lisp
>
> Is it because it's a primitive?

Yes.

For extra credit: try to define EQ in lisp without depending on
the compiler to open-code EQ, e.g. :

(declaim (notinline eq))

(defun eq (x y)
  ;;; ????
)

(This is a koan; if you think about it long enough, you'll either
achieve enlightenment or get a bad headache.)





>
> Thanks
> 	Mth
>
>
>
>
>
>
>
>
>
> ___________________________________________________________________________
> Yahoo! Mail r?invente le mail ! D?couvrez le nouveau Yahoo! Mail et son interface r?volutionnaire.
> http://fr.mail.yahoo.com
>



More information about the Openmcl-devel mailing list