Email list hosting service & mailing list manager


Re: [scheme-requests-for-implementation/srfi-209] Implementation: New representation of enum-sets, misc. updates (#6) Wolfgang Corcoran-Mathe 24 Nov 2020 00:36 UTC

On 2020-11-20 12:04 +0100, Marc Nieper-Wißkirchen wrote:
> May I recommend adding a note to the SRFI document saying that for the
> purpose of efficiency and early error detection it is recommended to
> work with enum-sets instead of individual enums wherever it is
> possible and to use the syntactic form defined by define-enum to
> construct enum-sets instead of the procedural interface when possible?
>
> [snip]
>
> ... are not in an enumeration set. On the other hand, operations with
> enumeration sets are pretty fast as they just have to work on strings
> of bits.

They *may* be pretty fast.  Nothing in the SRFI requires the bitmap
representation, so using enum-sets rather than individual enums doesn't
necessarily get you anything.

Unless John wants to specify the complexity requirements of enum sets
in more details, I don't think such a recommendation should be added.
In addition, presenting enum objects then saying "don't use them, use
singleton enum-sets" would really suggest there's something wrong with
the SRFI, the sample implementation, or both.

I have similar objections with regard to define-enum's supposed "early
error detection".  This doesn't make sense unless the macro is actually
required to raise errors at expansion-time, which it currently isn't.

--
Wolfgang Corcoran-Mathe  <xxxxxx@sigwinch.xyz>

"Prolonged contact with the computer turns mathematicians into
clerks and vice-versa." --Alan J. Perlis