[armedbear-devel] eql for java objects

Alan Ruttenberg alanruttenberg at gmail.com
Sun Apr 25 08:17:50 UTC 2010


(eql (jfield-raw "org.armedbear.lisp.Stream" "platformEolStyle")
(jfield-raw "org.armedbear.lisp.Stream" "platformEolStyle"))
->
NIL
I think it should be eql, probably eq.
I know they are equal.

The documentation for eq says:
Returns true if its arguments are the same, identical object;
otherwise, returns false.

They are and they are not. That they are not is only a quirk of the
implementation.

eql adds equality for characters and numbers

I'd argue that was done because of uncertainly over boxing in
different implementations and not wanting to fall back to a more
expensive equal call. Seems that java objects are an equivalent case.

Where this matters is that case and friends use eql for comparison.
One ought to be able to write a standard case statement that switches
off of an enum defined java, but one can't at the moment.

That's all,
Alan




More information about the armedbear-devel mailing list