| Deutsch English Français Italiano |
|
<vvashh$ra84$1@dont-email.me> View for Bookmarking (what is this?) Look up another Usenet article |
Path: ...!weretis.net!feeder9.news.weretis.net!news.quux.org!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: Mon, 5 May 2025 21:29:19 +0400
Organization: A noiseless patient Spider
Lines: 72
Message-ID: <vvashh$ra84$1@dont-email.me>
References: <87bjtn2hct.fsf@gmail.com>
<nnd$3b017059$6aa9c908@b5507bbc6e704cf6>
<5ce2cb85311aa91fcb7ab57c802aef09b3345163@i2pn2.org>
<nnd$1667d791$2eba7243@d7216ffec373a0d9>
<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>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Mon, 05 May 2025 19:29:22 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="b802166d6bcac374db4f5e210d68b5fa";
logging-data="895236"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/iRte3/bTlqHX+pDAQ2fAJ"
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:I65+PBncbvBkXM8nPu6WPOefIII=
Content-Language: en-US
In-Reply-To: <6a9a2b6e873c1b72bdec2c72749ef0aac6f33f42@i2pn2.org>
Bytes: 3234
On 2025-05-05 08:11, dxf wrote:
> On 4/05/2025 11:33 pm, Anton Ertl wrote:
>> ...
>> Here's the code I give to the Forth systems:
>>
>> 1 .( a ) cr -56 throw .( b )
>> .s
>> 2 .( a ) cr quit .( b )
>> .s
>> : foo 3 -56 throw ; ' foo catch 5
>> .s
>> : bar 4 quit ; ' bar catch 6
>> .s
>>
>> Let's see what different Forth systems do:
>> ...
>
> In DX-Forth QUIT is not CATCHable thus -56 THROW simply returns:
>
> a
> THROW #-56
>
> However modifying it to do so gives these results:
>
> 1 .( a ) cr -56 throw .( b )
>
> 'a' is displayed and the stack is: 1
This violates the behavior of `throw` specified in 9.6.1.2275,
because if there is no a user's exception frame, the data stack must be
emptied.
The table 9.1 in Forth-2012 (or 9.2 in Forth-94) does not affect the
behavior of `throw` at all.
Your implementation will probably fail the following test case:
t{ 123 [: 999 -56 throw ;] catch 456 -> 123 -56 456 }t
>
> 2 .( a ) cr quit .( b )
>
> 'a' is displayed and the stack is: 2
>
> : foo 3 -56 throw ; ' foo catch 5
>
> stack is: -56 5
These cases are standard-compliant.
>
> : bar 4 quit ; ' bar catch 6
>
> stack is: -56 6
>
This violates `quit` 6.1.2050, because:
- `quit` is not allowed to remove anything from the data stack (in
this case, remove 4 from the stack);
- `quit` is not allowed to place anything on the data stack (in this
case, place `-56`);
- `quit` is not allowed to interpret the remaining part of the input
buffer (in this case, interpret "6" and place 6 on the stack).
--
Ruvim