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 Lassi Kortela 14 Dec 2022 12:42 UTC

> 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.