Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

equals on hash tables is not yet functioning correctly #6

Open
anticrisis opened this issue Sep 6, 2017 · 0 comments
Open

equals on hash tables is not yet functioning correctly #6

anticrisis opened this issue Sep 6, 2017 · 0 comments

Comments

@anticrisis
Copy link

Sorry to report but something strange is going on. It appears as if the implementation is incomplete. Two simple hash tables are being reported as EQUALS T despite the fact that one has 1 item and the other has zero items.

CL-USER> (ql:quickload :generic-comparability)
To load "generic-comparability":
  Load 1 ASDF system:
    generic-comparability
; Loading "generic-comparability"

(:GENERIC-COMPARABILITY)
CL-USER> (in-package :generic-comparability)
#<PACKAGE "GENERIC-COMPARABILITY">
GENERIC-COMPARABILITY> (defvar a (make-hash-table :test 'equal))
A
GENERIC-COMPARABILITY> (defvar b (make-hash-table :test 'equal))
B
GENERIC-COMPARABILITY> (equals a b)
T
GENERIC-COMPARABILITY> (setf (gethash "a" a) 1)
1
GENERIC-COMPARABILITY> (equals a b)
T
GENERIC-COMPARABILITY> a
#<HASH-TABLE :TEST EQUAL :COUNT 1 {1001D4C343}>
GENERIC-COMPARABILITY> b
#<HASH-TABLE :TEST EQUAL :COUNT 0 {1001D4F013}>
GENERIC-COMPARABILITY> (equals b a)
T
GENERIC-COMPARABILITY> (defvar c (make-hash-table))
C
GENERIC-COMPARABILITY> (defvar d (make-hash-table))
D
GENERIC-COMPARABILITY> (equals c d)
T
GENERIC-COMPARABILITY> (setf (gethash :a c) 1)
1
GENERIC-COMPARABILITY> (equals c d)
T
GENERIC-COMPARABILITY> c
#<HASH-TABLE :TEST EQL :COUNT 1 {1001FCEB53}>
GENERIC-COMPARABILITY> d
#<HASH-TABLE :TEST EQL :COUNT 0 {1001FDEB13}>
GENERIC-COMPARABILITY> (equals c d :by-key nil)
T
GENERIC-COMPARABILITY> (equals a b :by-key nil)
T
GENERIC-COMPARABILITY> (equals c d :by-key t)
T
GENERIC-COMPARABILITY> 
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant