Safe enumerations for codesets Lassi Kortela (13 Dec 2022 12:09 UTC)
Re: Safe enumerations for codesets Marc Nieper-Wißkirchen (14 Dec 2022 08:17 UTC)
Re: Safe enumerations for codesets Lassi Kortela (14 Dec 2022 09:05 UTC)
Re: Safe enumerations for codesets Lassi Kortela (14 Dec 2022 09:39 UTC)
Re: Safe enumerations for codesets Marc Nieper-Wißkirchen (14 Dec 2022 11:29 UTC)
Re: Safe enumerations for codesets Lassi Kortela (14 Dec 2022 12:42 UTC)
Re: Safe enumerations for codesets Marc Nieper-Wißkirchen (14 Dec 2022 18:26 UTC)
Re: Safe enumerations for codesets Lassi Kortela (15 Dec 2022 09:29 UTC)
Re: Safe enumerations for codesets Lassi Kortela (15 Dec 2022 09:48 UTC)

Re: Safe enumerations for codesets Marc Nieper-Wißkirchen 14 Dec 2022 18:26 UTC

Am Mi., 14. Dez. 2022 um 13:42 Uhr schrieb Lassi Kortela <xxxxxx@lassi.io>:
>
> > You don´t write (define-enumeration <errno> ...) but
> > (define-enumaration errno (EPERM ...) errno-set).
> >
> > Then (errno EPERM) => 'EPERM (with compile-time checking whether EPERM
> > is allowed!)
>
> I see. That works out well (with no changes to the SRFI):
>
> (define-enumeration errno
>    (EPERM
>     ENOENT
>     ESRCH
>     EINTR
>     EIO
>     ENXIO
>     E2BIG
>     ENOEXEC
>     EBADF
>     ECHILD
>     EDEADLK
>     ENOMEM
>     EACCES
>     EFAULT)
>    errno-set)
>
> (codeset-message 'errno (errno ENOENT))
>
> The only problem is that the name of the set, 'errno, is still quoted.

I would say that an implementation should export an enumeration type
such that, e.g. (codeset errno) expands to 'errno, and such that
(codeset lassi) will be a syntax error (meaning that the lassi codeset
is not supported).