equal fails on symbol-names
Bug #1200503 reported by
George Vanecek
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
SBCL |
Invalid
|
Undecided
|
Unassigned |
Bug Description
This seems like a bug in the equal function.
Given that
(symbol-name 'abc) => "abc"
(equal "abc" "abc") => t
why then do you get
(equal (symbol-name 'abc) "abc") => nil
Why does this matter? cause I need to create a (make-hash-table :test 'equal) that can take keys that are either simple-strings or the symbol-names. Am I missing something or is this a bug in equal?
Changed in sbcl: | |
status: | New → Invalid |
To post a comment you must log in.
status invalid
done
George Vanecek <email address hidden> writes:
> Public bug reported:
>
> This seems like a bug in the equal function.
> Given that
>
> (symbol-name 'abc) => "abc"
Are you *sure* that this is a given? This code, as written, can never
produce the answer that you have stated.
> (equal "abc" "abc") => t
>
> why then do you get
>
> (equal (symbol-name 'abc) "abc") => nil
Under default reader conditions, (symbol-name 'abc) is "ABC". Under
other reader conditions, executing (symbol-name 'abc) either returns
"ABC" or signals an error about an undefined function |symbol-name|.
I'm closing this bug because I think that the most likely cause is
misunderstanding how the CL reader handles case. If I'm wrong, please
provide an exact code transcript showing the error.
Christophe