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 > Re: Is this wor...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 7 of 9 Topic 3829 of 4288
Post > Topic >>

Re: Is this workable? .warning .error

by Albert van der Horst <albert@[EMAIL PROTECTED] > Mar 13, 2008 at 10:30 AM

In article
<3a3113f4-8db9-451e-9809-768277b15ebc@[EMAIL PROTECTED]
>,
Bruce McFarling  <agila61@[EMAIL PROTECTED]
> wrote:
>On Mar 12, 6:43 pm, Albert van der Horst <alb...@[EMAIL PROTECTED]
>
>wrote:
>>  <m_l...@[EMAIL PROTECTED]
> wrote:
>> >Maybe, something like
>> >: myerror ?DUP IF . ABORT THEN ;
>> >?
>
>> : ?ERROR SWAP IF  ( optionally store information) THROW ELSE DROP THEN
;
>
>(1) Obviously this is after the warning string has been show ... there
>is nothing to swap.

I see, I overlooked the .
So it should have been
: ?ERROR ?DUP IF ( store information) THROW THEN ;

The idea is that information is not shown at this point yet.
The error can still be caught and cause no output. If the exception
leads to a message to the end user the information stored can be put
to good use.
That is the difference with a throw.

For example you could have an exception "root of negative number"
that sometimes is caught and causes an application to switch
to using complex numbers.  This is not for the square root itself
to decide, nor do you want spurious messages.

>
>(2) Not requiring THROW to be present but able to using THROW if it is
>available and the configuration file asks for it, is the primary
>design objective.

>
>If THROW was assumed to always be present and always be desired, .Nicl-
>err would be:
>
>: .Nicl-err ( throw# ca u ) {.Nicl-warn} EXECUTE THROW ;

Phrased otherwise :
if {.Nicl-warn} at this point unconditionally and direct outputs
information, one of the advantages of THROW would be lost.

The alternative is not hard. It could store a string somewhere.
Then a f.p. application is started with an overall catch.
At that point the exception is confirmed as a problem and the
string printed.

Note that one string buffer is sufficient.
(Flash! I've got to improve ABORT" in this way.)

Groetjes Albert

--
-- 
Albert van der Horst, UTRECHT,THE NETHERLANDS
Economic growth -- like all pyramid schemes -- ultimately falters.
albert@[EMAIL PROTECTED]
 &=n http://home.hccnet.nl/a.w.m.van.der.horst
 




 9 Posts in Topic:
Is this workable? .warning .error
Bruce McFarling <agila  2008-03-10 16:25:51 
Re: Is this workable? .warning .error
m_l_g3@[EMAIL PROTECTED]   2008-03-12 09:40:57 
Re: Is this workable? .warning .error
Albert van der Horst <  2008-03-12 22:43:07 
Re: Is this workable? .warning .error
Bruce McFarling <agila  2008-03-12 10:22:02 
Re: Is this workable? .warning .error
m_l_g3@[EMAIL PROTECTED]   2008-03-12 10:52:47 
Re: Is this workable? .warning .error
Bruce McFarling <agila  2008-03-12 16:45:27 
Re: Is this workable? .warning .error
Albert van der Horst <  2008-03-13 10:30:31 
Re: Is this workable? .warning .error
Bruce McFarling <agila  2008-03-12 19:34:48 
Re: Is this workable? .warning .error
Bruce McFarling <agila  2008-03-13 05:40:17 

Post A Reply:
  Go here to Signup

AddThis Feed Button


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

Contact
tan12V112 Mon Oct 13 8:23:28 CDT 2008.