Re: The name "srfi-170-error" Lassi Kortela 27 Jun 2020 14:57 UTC
> This name is not going to make much sense when and if 170 is > incorporated into R7RS-large, in which case it will probably be called > (scheme posix) or (scheme posix core) or something of the sort. Perhaps > this facility should be migrated to SRFI 198 as well and called simply > "posix-error". That way any Posix-related SRFI can raise it and any of > their callers can check for it. - Windows API error reporting is similar to POSIX: there are pretty straightforward equivalents to errno (GetLastError()) and strerror (FormatMessage()). The same gotchas about a global error value also apply (GetLastError() needs to be called immediately after a syscall to be trusted; threads and other stuff can mess it up if retrieving the error code is postponed until later.) - Cygwin/MSYS programs can probably access both Unix syscall emulations (errno) and WinAPI calls (GetLastError()). There needs to be a meaningful way to distinguish between the two. - SRFI 170 procedures should be implementable using either Unix or Windows syscalls (or equivalents in other operating systems). This implies that SRFI 170 procedures can raise exceptions based on Unix errors, WinAPI errors, or a mix of the two. - "POSIX errno" is a misnomer since it copes identically with errno's that are not in POSIX. "Unix errno" or just "errno" would be appropriate.