Re: Remaining issues Marc Nieper-Wißkirchen 31 Oct 2020 08:36 UTC

Am Sa., 31. Okt. 2020 um 02:30 Uhr schrieb John Cowan <>:

> On Fri, Oct 30, 2020 at 2:04 PM Wolfgang Corcoran-Mathe <> wrote:
>> (1) Can we make empty enum types, i.e. should (make-enum-type '())
>> return a value?
> I suppose so, though I don't see a use case offhand.
>> (2) enum-set should take one or more arguments, since the empty enum
>> set has no determinable type.
> It's definitely a mistake that we can't have an empty set.  For example, if the enums represent binary properties of something, there is nothing wrong with the "all properties are false" state.  At one time I had an empty-set constructor, but it looked like `enum-set` could serve that purpose -- but it can't.
> I think the best bet is (enum-empty-set enum-type): added.

Hmmm... that doesn't like the right thing to me. If the zero-element
case need special treatment, something is flawed.

Either let `enum-set` always take a type as its first argument (which
can then be checked to assert the other arguments are of this type),
or let `make-enum-type` return two values, the second one being the
type-parameterized `enum-set`.

Or use the idea of R6RS's enumerations, which is enum-set-constructor
applied to the type.

PS Speaking of R6RS, why is there no define-enumeration in this SRFI?