This is the mail archive of the
kawa@sourceware.cygnus.com
mailing list for the Kawa project.
Re: equal? and arrays
- To: Luke Gorrie <luke at bluetail dot com>
- Subject: Re: equal? and arrays
- From: Per Bothner <per at bothner dot com>
- Date: 07 Mar 2000 09:45:48 -0800
- Cc: kawa at sourceware dot cygnus dot com
- References: <lhvh2z6l50.fsf@cockatoo.bluetail.com>
Luke Gorrie <luke@bluetail.com> writes:
> Should 'equal?' give #t for two equal arrays?
Ideally, yes.
>
> I guess this is a side-effect of the implementation of equal(Object)
> for arrays in java?
Yes, assuming s/equal/equals/.
equals? is implemented in terms of Object.equals(Object).
It is possible to add a special case for primitive arrays,
but I am loath to give up the the equals? <--> equals
correspondance.
equal? is not the end-all of quality predicates. For example
it would be helpful to have an equaility predicate that can
handle circular lists and trees.
--
--Per Bothner
per@bothner.com http://www.bothner.com/~per/