=

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 ==.

Exported from

Modifiers

open

Arguments

object1An instance of <object>.
object2An instance of <object>.

Values

booleanAn instance of <boolean>.

See also

Summary
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 instances of <list>, = returns true if the two lists are the same size, corresponding elements of list1 and list2 are = and the final tails are =.
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 =.

Functions

=

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 instances of <list>, = returns true if the two lists are the same size, corresponding elements of list1 and list2 are = and the final tails are =.  It 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.

The class of complex numbers, including real numbers.
The class of collections, aggregate data structures.
Returns the function used by its collection argument to compare keys.
The class of collections whose keys are consecutive integers starting from zero.
Compares two objects for equality.
The class of linked lists.
Compares two objects for identity.
The class of all Dylan objects.
The class of symbols.
The class of characters.
The class of boolean values.
The common-dylan module.
Whenever possible, we have tried to keep the Dylan module pristine and unextended, preferring to add our extensions to separate modules or libraries.
Dylan provides an identity function, as well as a group of equality and magnitude comparison functions that can be extended for user classes.