Skip to content

key-comparison maze of arrays unclear test of identity or internal structure #798

Closed
@driftsignal

Description

@driftsignal

the equality test for maze of arrays appears to test for identity.

key-comparison-test.lisp line 115-118:

    (:room-arrays
      . (((,+an-array+ ,+a-similar-but-different-array+) . explosion)
      ((,+an-array+ ,+an-array+) . victory)))

the readme suggests internal comparison:

6. The maze of arrays

This maze is simpler with only two rooms. The first needs a key that checks if the arrays contain the equal contents. The second needs a key that is more flexible about checking equality of numbers.

For example:

a                        ; => #[13 23]
b                        ; => #[13 23.0]

(key-arrays a b)         ; => NIL
(key-arrays-loosely a b) ; => T

because a permissive equality predicate will not consider numeric type when comparing the contents of an array.

would it make sense for the readme or the tests be updated to mirror each other?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions