Stephen Pelc wrote:
> As far as possible within historical and commercial constarints,
> MPE has attempted to make iors THROWable. The only downside has
> been some necessary conversion of operating system error codes
> to ANS or application error codes.
We do that, too (both in Gforth and bigFORTH), and use a separate IOR
space
for OS errors. We don't convert IORs into ANS or application error codes,
but we provide a way to print IORs in a meaningful way (.error takes a
throw code or an IOR, and prints an error message, using strsignal and
strerror from libc to convert IORs into strings - or the related Windows
function, which I can't recall at the moment).
Error space is from -256 to -511 for signals, and from -512 to -2047 for
system errors (IORs). We do convert signal codes that have a meaning in
ANS
Forth to ANS Forth codes, like interruption (^C).
> Extend the THROW code table (Table 9.2 in 9.3.5) so that there is
> a separate THROW code for each word that returns an ior.
That doesn't seem such a clever idea for me. If OPEN-FILE fails, I'd
rather
want to know why it failed ("permission denied", "illegal character in
file
name", or "out of file handles" or whatever the problem is) than that it
was OPEN-FILE which failed. I probably get that information out of the
backtrace anyway.
--
Bernd Paysan
"If you want it done right, you have to do it yourself"
http://www.jwdt.com/~paysan/


|