[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Scheme-reports] equal?



> (equal? obj1 obj2) procedure
> 
> The equal? procedure, when applied to pairs, vectors, strings and bytevectors, recursively compares them, returning #t when the unfoldings of its arguments into (possibly infinite) trees are equal as ordered trees, and #f otherwise. It returns the same as eqv? when applied to booleans, symbols, numbers, characters, ports, procedures, and the empty list. If two objects are eqv?, they must be equal? as well. In all other cases, equal? may return either #t or #f.

What, precisely, does it mean to say that the "trees are equal". I suggest:

"returning #t when the unfoldings of its arguments into (possibly infinite) trees are equal as ordered trees, with corresponding leaves being compared by equal?, and #f otherwise"

There may well be better ways to say this. Alternatively, I think one could say that the leafs are compared by eqv? (since structure has been unfolded).

Regards,

Alan
_______________________________________________
Scheme-reports mailing list
Scheme-reports@x
http://lists.scheme-reports.org/cgi-bin/mailman/listinfo/scheme-reports