Compares two objects for equality. Returns true if object1 and object2 are equal. Otherwise, it returns false.
Programmers may define methods for = specialized on classes they define. A programmer may be required to provide an = method when defining subclasses of some predefined classes in order to fulfill the protocol of the class, as described below. For objects that do not have a more specific = method, = returns the same as ==.
= is not guaranteed to return. For example, it may not return when called on circular structures or otherwise unbounded structures.
In addition to the sealed domains specified by the methods below, = is sealed over the following domains:
The default method on = calls == and returns the result returned by ==.
open
| object1 | An instance of <object>. |
| object2 | An instance of <object>. |
| boolean | An instance of <boolean>. |
Compares two objects for equality. | |
Two instances of <complex> are equal if they have the same mathematical value. | |
Two instances of <collection> are equal if they have identical key-test functions, they have the same keys (as determined by their key-test functions), the elements at corresponding keys are =, and neither collection is a dotted list. | |
For instances of <sequence>, = returns true if sequence1 and sequence2 have the same size and elements with = keys are =, and returns false otherwise. | |
For mixed lists and sequences, = returns true if the list is not a dotted list, both have the same size, and elements with = keys are =. |
Two instances of <complex> are equal if they have the same mathematical value.
Two instances of <collection> are equal if they have identical key-test functions, they have the same keys (as determined by their key-test functions), the elements at corresponding keys are =, and neither collection is a dotted list.
For instances of <sequence>, = returns true if sequence1 and sequence2 have the same size and elements with = keys are =, and returns false otherwise.
For mixed lists and sequences, = returns true if the list is not a dotted list, both have the same size, and elements with = keys are =. It returns false otherwise.