Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Forth Mac > Re: RfD - THROW...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 2 of 5 Topic 124 of 161
Post > Topic >>

Re: RfD - THROW codes and Iors

by Bernd Paysan <bernd.paysan@[EMAIL PROTECTED] > Aug 21, 2006 at 05:29 PM

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/
 




 5 Posts in Topic:
RfD - THROW codes and Iors
stephenXXX@[EMAIL PROTECT  2006-08-21 14:56:59 
Re: RfD - THROW codes and Iors
Bernd Paysan <bernd.pa  2006-08-21 17:29:48 
Re: RfD - THROW codes and Iors
Albert van der Horst <  2006-08-22 19:22:36 
Re: RfD - THROW codes and Iors
anton@[EMAIL PROTECTED]   2006-08-24 21:40:27 
Re: RfD - THROW codes and Iors
"werty" <wer  2006-09-05 11:13:00 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Sat Nov 22 13:48:40 CST 2008.