Deutsch   English   Français   Italiano  
<10076jg$3nh2i$1@dont-email.me>

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

Path: ...!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!eternal-september.org!.POSTED!not-for-mail
From: Ruvim <ruvim.pinka@gmail.com>
Newsgroups: comp.lang.forth
Subject: Re: QUIT and ABORT
Date: Fri, 16 May 2025 15:12:48 +0400
Organization: A noiseless patient Spider
Lines: 56
Message-ID: <10076jg$3nh2i$1@dont-email.me>
References: <87bjtn2hct.fsf@gmail.com>
 <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>
 <0c4bc1ac6f9595ebc81448f21aade5d54639ada9@i2pn2.org>
 <vvk6s9$2jjoh$1@dont-email.me>
 <5069a2ba51509e4f92ffa680982a4e353ec45ab8@i2pn2.org>
 <vvlke3$2neud$1@dont-email.me> <vvvlin$1rk75$1@dont-email.me>
 <696f4a3105690a7ea898d1778a37d345cbd4c598@i2pn2.org>
 <1001gaa$2b9mr$2@dont-email.me>
 <9d4eb41927bc7282d1568054a0d94b5a0f60056b@i2pn2.org>
 <1006jsi$3js21$1@dont-email.me>
 <e32f5681efc287a2089300a61fc8db21d04ff7d0@i2pn2.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Fri, 16 May 2025 13:12:50 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="e1c8b6f4eec558b47b4fdad1c2a8b7f3";
	logging-data="3916882"; mail-complaints-to="abuse@eternal-september.org";	posting-account="U2FsdGVkX180ynTuy2LuQiS5wlQrHB5f"
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:A0K2PjT8AT5l+3wPMREk5m6F7L8=
In-Reply-To: <e32f5681efc287a2089300a61fc8db21d04ff7d0@i2pn2.org>
Content-Language: en-US
Bytes: 3646

On 2025-05-16 12:19, dxf wrote:
> On 16/05/2025 3:53 pm, Ruvim wrote:
>> On 2025-05-15 06:14, dxf wrote:
>>> ...
>>>
>>> CATCH has already done the damage.  It would be naive for a programmer
>>> to assume he can re-throw QUIT and it will be as if nothing ever happened.
>>
>> My point is that such a word is completely useless.
> 
> The goal is catching fish.  What happens to the ones you catch and then
> decide to throw it back in is relatively minor.  If they end up a bit
> worse for wear that's just how it is.

Could you please provide a practical use case for this? The standard 
`quit` is useful for debugging, at the least.

If your goal is to catch `quit` in your program, just redefine `quit` 
accordingly. Then, of course, the system is not a standard Forth system 
after loading your program (see 4.2.2).



>>> Presumably an implementer of a catchable QUIT actually wants it caught.
>>> The question then is what can he do for the occasions when he wants it
>>> impervious to CATCH and there are solutions for that.
>>>
>>
>> What solution do you mean?
> 
> Default behaviour of QUIT is Core QUIT.  THROW handles -56 by jumping to
> Core QUIT.

If you make `throw` do this regardless of whether a user's exception 
frame exists in the exception stack, you make the `-56` error code 
uncatchable. So, the following test case will fail:

   t{  [: -56 throw ;] catch -> -56 }t

And what is the benefit?



>  The application programmer then has the option of making QUIT
> catchable by defining:
> 
>    : QUIT -56 THROW ;
> 

But this option already exists. There is no need to specially handle 
`-56` in `throw`.


--
Ruvim