equal
equal(g_arg1g_arg2) =>t/nil
Description
Checks contents of strings and lists when testing for equality.
Checks if two arguments are equal or if they are logically equivalent, for example, g_arg1 and g_arg2 are equal if they are both lists/strings and their contents are the same. This test is slower than using eq but works for comparing objects other than symbols.
-
If the arguments are the same object in virtual memory (that is, they are
eq),equalreturnst. -
If the arguments are the same type and their contents are equal (for example, strings with identical character sequence),
equalreturnst. -
If the arguments are a mixture of fixnums and flonums,
equalreturnstif the numbers are identical (for example, 1.0 and 1).
Arguments
|
Any SKILL object. g_arg1 and g_arg2 are tested to see if they are logically equivalent. |
|
Value Returned
Examples
x = 'cat
equal( x 'cat )
=> t
x == 'dog
=> nil ; == is the same as equal.
x = "world"
equal( x "world" )
=> t
x = '(a b c)
equal( x '(a b c))
=> t
equal(2 2.0)
=> t
Related Topics
Logical and Relational Functions
Return to top