Search the web
Sign In
New User? Sign Up
forth200x
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Hear how Yahoo! Groups has changed the lives of others. Take me there.

Best of Y! Groups

   Check them out and nominate your group.
Having problems with message search? Fill out this form to ensure your group is one of the first to be migrated to the new message search system.

Messages

  Messages Help
Advanced
CfV: Throw IORs   Message List  
Reply | Forward Message #175 of 425 |
Re: [forth200x] Re: CfV: Throw IORs

Stephen Pelc wrote:
> > Posted by: "Bernd Paysan" bernd.paysan@... berndpaysan
> > If you relax your proposal in such a way that IORs must be throwable,

The proposal is now in the CfV stage and therefore frozen, so it
cannot be revised in any significant way. Someone could do an
alternative proposal that addresses the same problem, though.

> The proposal does not say that you *must* use these numbers, it
> says that if you use these numbers, this is what the standard
> means by those specific numbers. Consequently gForth will not
> conflict with the proposal.

So if ALLOCATE returns an ior value of, say, -524 if it fails, would
you see that as an implementation of your proposal?

> > I like to keep as much information as possible about the
> > original error, so mapping errors to words that
> > misbehave isn't such a good idea - a word like
> > WRITE-FILE can fail for quite a number of reasons (no
> > space left on device, pipe closed, low-level IO error,
> > buffer outside address space, etc.). A backtracing
> > utility is a better way to locate the error, and you'll
> > then see which word misbehaved, as well.
>
> Given the range of hardware and O/S, it is impossible in a
> standard to go beyond saying that WRITE-FILE failed and a THROW
> occurred.

It's not necessary to go beyond. It's not even necessary to go that far.

It's only necessary that the values returned as iors by standard words
make sense as THROW values. E.g., if the system returns -540 for a
failed WRITE-FILE, then -540 THROW should produce a sensible error
message (like "No space left on device") when the system catches it.
But that's a requirement that I don't see in the proposal.

The difference the proposal should make is between:

Wrong (pfe-0.9.14):

s" /etc/xxx" w/o create-file .s
2 [0000000000000002]
0 [0000000000000000] ok
throw
Error: "throw" 2 THROW unassigned
throw
^

Better (pfe-0.33.34):
s" /etc/xxx" w/o create-file .s
13 [0000000D]
0 [00000000] ok
throw
Error: Permission denied : "throw"
throw
^^^^^^ ok

But still not quite there, because 13 is not in the range of
system-defined throw codes.


Good (gforth-0.6.2):
s" /etc/xxx" w/o create-file .s <2> 0 -525 ok
throw
*the terminal*:2: Permission denied
throw
^^^^^
Backtrace:

- anton



Wed Jul 11, 2007 2:19 pm

anton@...
Send Email Send Email

Forward
Message #175 of 425 |
Expand Messages Author Sort by Date

This is actually a poll about how widely the proposal is implemented and how popular it is among the programmers. It is called a CfV (call-for-votes) because...
Peter Knaggs
pknaggs
Offline Send Email
Jul 10, 2007
10:02 pm

... The ballot system doesn't work well to describe how Gforth and bigFORTH do it, so I explain it in words: Gforth and bigFORTH have made IORs throwable since...
Bernd Paysan
berndpaysan
Offline Send Email
Jul 11, 2007
8:01 am

... The proposal does not say that you *must* use these numbers, it says that if you use these numbers, this is what the standard means by those specific...
Stephen Pelc
sfprem
Offline Send Email
Jul 11, 2007
10:29 am

... The proposal is now in the CfV stage and therefore frozen, so it cannot be revised in any significant way. Someone could do an alternative proposal that...
Anton Ertl
anton@...
Send Email
Jul 11, 2007
2:19 pm

... Yes. ... Yes. However, the list of THROW codes in the proposal only reserves numbers for use. There is nothing in it to stop you carrying on using the...
Stephen Pelc
sfprem
Offline Send Email
Jul 12, 2007
1:33 pm
Advanced

Copyright © 2009 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines - Help