src/class-finalize-impl.lisp: Check for duplicates with the right `:test'.
authorMark Wooding <mdw@distorted.org.uk>
Sat, 10 Aug 2019 00:17:00 +0000 (01:17 +0100)
committerMark Wooding <mdw@distorted.org.uk>
Sat, 10 Aug 2019 14:47:06 +0000 (15:47 +0100)
commited3ce6c2352d76442b79badfbe08bc6ecde6934d
tree8d07717f4d468d1a406d329a2dc5fe5a6767559a
parent211bf0df3e49bda800a748474ada19dff6f15b5f
src/class-finalize-impl.lisp: Check for duplicates with the right `:test'.

I noticed that Sod failed to diagnose a class containing duplicate slot
names.  Thinking that this was a stupid omission, I kludged a check into
`make-sod-slot' (and a matching check into `make-sod-message'), thinking
that it seemed rather difficult to provide a proper location of the
existing definition.  Then I tripped over this code, and wondered why it
wasn't working.  Of course, the problem was that it tries to compare
strings using `eql'.  Fix this.

Use `equal' here rather than the more specific `string=' because (a)
`find-duplicates' uses a hashtable if the :test function is suitable,
and (b) it reports the duplicates in the right order in that
codepath.  (That the other codepaths don't work the same way is, of
course, a bug which should be fixed.)
src/class-finalize-impl.lisp
test/bad.ref
test/bad.sod