Implemented NUMERICAL-EQUAL as a generic function.
commit0f863ee8afb517a906bf585680ec5e79dac766ff
authorThomas M. Hermann <tmh.public@gmail.com>
Wed, 15 Apr 2009 04:00:49 +0000 (14 23:00 -0500)
committerThomas M. Hermann <tmh.public@gmail.com>
Wed, 15 Apr 2009 04:00:49 +0000 (14 23:00 -0500)
treec4886e2bed609f56d2422f163339f682ced6a79b
parent5bc3476740e44da176a15d42bf02cc1d703e398d
Implemented NUMERICAL-EQUAL as a generic function.

Implemented NUMERICAL-EQUAL as a generic function per Liam Healy's
suggestion so that specific tests can be written for data objects
external to LISP-UNIT. There are versions of NUMERICAL-EQUAL written
for the system classes NUMBER, LIST, VECTOR and ARRAY.

Removed SEQ-EQUAL and ARRAY-EQUAL since these are now covered by
NUMERICAL-EQUAL.

NOTE : Thought about using TREE-EQUAL for the LIST version, but
realized that it is not guaranteed that the branches will be only
lists or numbers. The branches could be anything. Actually, TREE-EQUAL
could be used like this:

(tree-equal result1 result2
            :test (lambda (r1 r2)
                   (numerical-equal r1 r2 :test test)))

But, that obfuscates the solution a little and doesn't reduce the
dispatch at all.

BURIED CHANGE : I updated the MAKE-RANDOM-2D-ARRAY to specialize the
element type based on the limit keyword.
TODO
defpackage.lisp
floating-point.lisp