Re: Synthetic errno values
hga@xxxxxx 16 Aug 2020 12:39 UTC
Quick reply on just one detail we're currently discussing.
> From: Lassi Kortela <xxxxxx@lassi.io>
> Date: Sunday, August 16, 2020 2:58 AM
>
> [ Big snip. ]
>
>> Sorry if I haven't been clear, ***libsodium and many other C libraries
>> do not have a number to report as such***. Where I take "number" to
>> be something like an integer errno, or a 5 byte SQLSTATE.
>>
>> We translate its specific UNIX style 0 vs. -1 return into either a
>> binary 'success? value, or just make that subkey (which is optional
>> to define and include in the status object) only return errors. If
>> it never has to report a success as a status object, the UNIX silence
>> is success principle, which is also used as the fundamental error
>> handling paradigm for SRFI 170, 205, etc.
>
> Good point. On success we simply don't raise an error, so any raised
> 'libsodium status is an error status.
>
> I agree with you that we need to have _some_ property that says
> 'libsodium. I'm not sure 'set is the right one.
That's what I'm envisioning 'subset for. I.e.:
'(set genetic-c-lib subset libsodium)
'(set sqlstate subset postgresql)
> 'errno is clearly an error set, but all errno errors don't come from
> POSIX either.
And thus perhaps '(set posix/errno/whatever subset native-windows). But
maybe not 'linux, 'openbsd, or any other system that claims to be
"actual, real not emulated POSIX" or thereabouts.
- Harold