(eq? ..args) args: two or more arguments (any type) returns a bool
Returns #t
if all of its arguments are equal to one another.
Each successive pair of arguments is compared in turn. If any of the comparisons are false, the function returns early.
-
Numbers and characters are compared using
==
. -
Arrays are equal if they have the same length, and each element is equal to the corresponding element in the other array.
-
Strings are equal if they have the same length and the same characters.
-
Tables are equal if they have the same set of keys (based on key-equivalence), and if each value is equal to the corresponding value in the other table.
-
Otherwise, two values are equal if they share the same identity.
This behaviour can be overridden for objects and RData
by defining an op-eq?
method.
If (.op-eq? a b)
returns #f
or #n
, then a
and b
are not equal.