I'm defining enum identity as eqv? rather than eq?, because eqv? is Scheme's identity predicate.  Here's the new definition of enum=?:

Returns #t if all the arguments are the same enum in the sense of eqv? (which is equivalent by construction to having the same name and ordinal) and #f otherwise. It is an error to apply enum=? to enums belonging to different enum types.


On Tue, Sep 15, 2020 at 3:06 PM Marc Nieper-Wißkirchen <xxxxxx@nieper-wisskirchen.de> wrote:
Could we make enums comparable with eq? Enum=? will then be a
(possibly) type-checking wrapper around eq?.

I haven't yet checked the sample implementation, but to me, it seems
to be implementable without much overhead.

This will make enums equally fast than symbols in many use cases and
will easily allow them as keys in hash tables.

Marc