[r6rs-discuss] [Formal] Drop enumerations library?
On Thu, 2 Nov 2006, Michael Sperber wrote:
> Exactly: enumeration values are symbols by the enumerations library.
> However, endianness could have been represented differently. In fact,
> in SRFI 74, upon which the bytes objects are based, *does* represent
> them differently; we made a policy decision. To avoid all kinds of
> future APIs going seven different ways on the same issue, it makes
> sense to provide a standard one.
>
> - You give the expander a chance to report a spelling error in the
> name of the enum value statically. (How large a benefit that is
> depends on how well you type.)
>
> - You give a human reader information that this "little" thing is
> indeed an endianness. That's obvious when used directly in a call
> to a procedure from the bytes library, but less obvious when passed
> indirectly.
The first point is good. The second point I don't quite buy, since you could
have simply called the symbol "little-endian" instead of "little". In any case,
these benefits could be obtained extremely trivially implementation-wise in the
couple of libraries where they are needed without the need for the rather
heavyweight extra enumerations library.
Policy-wise, I would say that the IO and bytes libraries by themselves set a
policy or convention, which may, for uniformity, be followed by future
libraries. I still don't quite see why it is important to give this convention
its own library.
> We did consider that (and in fact I argued for this position), but the
> editors ended up rejecting the idea. All the gory details on that
> discussion are somewhere in the ML archives.
I would have probably agreed with you on the abstractness issue, and I can
certainly think of good examples of the utility of some kind of abstract
enumerated types. I would call them closed sum types, and there are definitely
good theoretical and practical reasons for using such types, though perhaps not
for standardizing them right now. But the current enumerations library are not
this.
Cheers
Andre
Received on Thu Nov 02 2006 - 11:26:10 UTC
This archive was generated by hypermail 2.3.0
: Wed Oct 23 2024 - 09:15:00 UTC