Deutsch   English   Français   Italiano  
<27193d56a2a0e6a0fe8b5dcb1668dde8bbcd886e@i2pn2.org>

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

Path: news.eternal-september.org!eternal-september.org!feeder3.eternal-september.org!i2pn.org!i2pn2.org!.POSTED!not-for-mail
From: dxf <dxforth@gmail.com>
Newsgroups: comp.lang.forth
Subject: Re: QUIT and ABORT
Date: Tue, 6 May 2025 11:33:26 +1000
Organization: i2pn2 (i2pn.org)
Message-ID: <27193d56a2a0e6a0fe8b5dcb1668dde8bbcd886e@i2pn2.org>
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>
 <vvashh$ra84$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Tue, 6 May 2025 01:33:29 -0000 (UTC)
Injection-Info: i2pn2.org;
	logging-data="3311704"; mail-complaints-to="usenet@i2pn2.org";
	posting-account="XPw7UV90Iy7EOhY4YuUXhpdoEf5Vz7K+BsxA/Cx8bVc";
User-Agent: Mozilla Thunderbird
In-Reply-To: <vvashh$ra84$1@dont-email.me>
X-Spam-Checker-Version: SpamAssassin 4.0.0
Content-Language: en-GB

On 6/05/2025 3:29 am, Ruvim wrote:
> On 2025-05-05 08:11, dxf wrote:
>> ...
>> 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

For that I get:

123 -56 456

>> : 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).

A caught ABORT does the same:

SwiftForth i386-Win32 3.11.9-RC1 01-Sep-2022

: bar 4 abort ; ' bar catch 6 .s
-1 6 <-Top  ok