Deutsch   English   Français   Italiano  
<0c4bc1ac6f9595ebc81448f21aade5d54639ada9@i2pn2.org>

View for Bookmarking (what is this?)
Look up another Usenet article

Path: ...!weretis.net!feeder9.news.weretis.net!news.nk.ca!rocksolid2!i2pn2.org!.POSTED!not-for-mail
From: dxf <dxforth@gmail.com>
Newsgroups: comp.lang.forth
Subject: Re: QUIT and ABORT
Date: Fri, 9 May 2025 10:54:14 +1000
Organization: i2pn2 (i2pn.org)
Message-ID: <0c4bc1ac6f9595ebc81448f21aade5d54639ada9@i2pn2.org>
References: <87bjtn2hct.fsf@gmail.com>
 <nnd$595f502c$48101358@27425914746d2863>
 <d9149a9d12db559e2720156b315fcfdcdd90e3fe@i2pn2.org>
 <2025May3.072517@mips.complang.tuwien.ac.at>
 <6973d7bc1d0376ab234a39a3dda82287b7b13450@i2pn2.org>
 <2025May3.180226@mips.complang.tuwien.ac.at>
 <b78a04cbc0fc7c0a6c041e46ea83dc7a6206e5d6@i2pn2.org>
 <2025May4.153331@mips.complang.tuwien.ac.at>
 <6a9a2b6e873c1b72bdec2c72749ef0aac6f33f42@i2pn2.org>
 <vvashh$ra84$1@dont-email.me>
 <60caba147f217f0c677ddc6bf8a7492a3c69688b@i2pn2.org>
 <2025May6.091324@mips.complang.tuwien.ac.at>
 <f3783e59aec9762f3871cfb39f36c514dc05f214@i2pn2.org>
 <vvg6l5$12kee$1@dont-email.me>
 <35ba145b7baa62154479eac080a2f6995b24b8e8@i2pn2.org>
 <vvi9b5$1ogea$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Fri, 9 May 2025 00:54:13 -0000 (UTC)
Injection-Info: i2pn2.org;
	logging-data="3726688"; mail-complaints-to="usenet@i2pn2.org";
	posting-account="XPw7UV90Iy7EOhY4YuUXhpdoEf5Vz7K+BsxA/Cx8bVc";
User-Agent: Mozilla Thunderbird
Content-Language: en-GB
X-Spam-Checker-Version: SpamAssassin 4.0.0
In-Reply-To: <vvi9b5$1ogea$1@dont-email.me>
Bytes: 3754
Lines: 41

On 8/05/2025 10:50 pm, Ruvim wrote:
> On 2025-05-08 06:52, dxf wrote:
>> On 8/05/2025 3:52 am, Ruvim wrote:
>>> ...
>>> I use `quit` only for testing and debugging. And I expect to get into the Forth text interpreter (Forth shell) exactly in the current program state (as far as possible).
>>>
>>> If `quit` simply calls `-56 throw`, the program state will probably change (due to actions after `catch` in the program, including restoring the data stack depth in `throw`) when you get into the Forth shell. Also, there is a chance that you will not get into the Forth shell at all if the program does not re-throw the error in some places.
>>>
>>> So I would not recommend the suggested deviation in the `quit` behavior even for new implementers, since this brakes the well-known expectation from `quit`. A better way is to introduce another word with desired behavior deviation.
>>
>> ANS never gave a rationale for ABORT ABORT" QUIT - only options that we're now
>> exploring.
>>
>> For the reasons you've stated I'm reluctant to define:
>>
>> : QUIT -56 THROW ;
>>
>> But are there reasons an application might were THROW able to handle it?
> 
> I don't see such a reason. The application can simply do `abort` or `-56 throw` (and no special cases are needed).

Yes but those would be workarounds.  It's making the argument QUIT can't or shouldn't
be caught whereas I'm talking about entitlement.  Speaking of entitlement, ANS made
EXCEPTION EXT a one-way street.  There's no rolling back from the changes.

> If you need the Forth shell in the application data stack and state — do `quit`. If you need to break the application execution — do `abort`.
> 
> 
> Probably, the external signal SIGTERM can be transferred to `-56 throw` in the Forth system, and the external signal SIGINT (Ctrl+C) can be transferred to `-28 throw`.
> 
> 
> 
>> It's arguable ANS left the door open. Just because the spec for THROW didn't
>> special-case -56 doesn't mean an implementer can't.
> 
> The implementer can special-case -56 (as well as anything else) only to the extent that it does not affect a standard program.
> 
> 
> -- 
> Ruvim
>