Re: QUIT and ABORT

Liste des GroupesRevenir à cl forth 
Sujet : Re: QUIT and ABORT
De : mhx (at) *nospam* iae.nl (mhx)
Groupes : comp.lang.forth
Date : 05. May 2025, 23:05:47
Autres entêtes
Organisation : novaBBS
Message-ID : <eb7292e0cd166c6a9c5ce7bd766179d4@www.novabbs.com>
References : 1 2 3 4 5 6 7 8 9 10 11
User-Agent : Rocksolid Light
On Sun, 4 May 2025 13:33:31 +0000, Anton Ertl wrote:

dxf <dxforth@gmail.com> writes:
On 4/05/2025 2:02 am, Anton Ertl wrote:
dxf <dxforth@gmail.com> writes:
[..]
In iForth 5.1-mini QUIT preserves the stack while an uncaught -56
THROW resets it to empty (as it should); the uncaught -56 THROW does
not produce a message.  For the cases with CATCH, the FOO variant does
not put the -56 on the stack and does not text-interpret the 5
afterwards, but it does preserve the 2 that was pushed earlier.
Strange.  The BAR variant behaves as expected.  If I try
>
2 : foo 3 1 throw ; ' foo catch 5
..s
>
iForth 5.1-mini behaves as follows:
>
FORTH> 2 : foo 3 1 throw ; ' foo catch 5  ok
[3]FORTH> .s
  Data: 2 1 5 ---
System: ---
 Float: --- ok
>
This is expected, so it seems to do something special for -56 THROW.
Searching for: -56 THROW
D:\dfwforth\examples\misc\risky-program.frt(3): \ A heated debate is
possible over the exact action -56 THROW should have. Should it QUIT ?
D:\dfwforth\examples\misc\risky-program.frt(57): 2: 1999 12 [ -56 throw -56 THROW executed
Found 3 occurrence(s) in 1 file(s), 39514 ms
There must have been a convincing reason.
-marcel
---
\ Het Vijgeblaadje #17, december 1999
\ CATCH en THROW (II) De Schoolmeester (Albert Nijhof)
\ A heated debate is possible over the exact action -56 THROW should
have.
\ Should it QUIT ?
ANEW -risky-program
: .DEPTH ( -- )
DEPTH 0 .R ." : "
DEPTH 0>= IF  exit  ENDIF
BEGIN  0  DEPTH 0=  UNTIL \ Repair stack if necessary
." Stack underflow " ;
: .TOP2 ( -- )
DEPTH 1 > IF  OVER .  ENDIF
DEPTH     IF  DUP  .  ENDIF ;
: .TOP4 ( -- )
DEPTH 4 > IF  ." ~ "  ENDIF
DEPTH 2 > IF  2>R .TOP2 2R>  ENDIF
.TOP2 ;
: STATE-SIGN ( -- )
STATE @ IF  [CHAR] ]
      ELSE  [CHAR] [
     ENDIF ;
: .SITUATION ( -- )
CR .DEPTH  .TOP4  STATE-SIGN EMIT  SPACE ;
CREATE inputbuffer #80 ALLOT
: INPUT ( -- addr len )
inputbuffer DUP #80 ACCEPT  SPACE ;
: RISKY-PROGRAM ( --)
.SITUATION  INPUT EVALUATE ;
: VB ( -- )
BEGIN
  ['] RISKY-PROGRAM CATCH
  ?DUP IF . ." THROW executed " ENDIF
AGAIN ;
DOC
(*
FORTH> vb
0: [ drop  -4 THROW executed
0: [ 12
1: 12 [ 1999
2: 12 1999 [ : zwap
2: 12 1999 ] qwerty  -2 THROW executed
2: 12 1999 ] 2>r
2: 12 1999 ] r> r>
2: 12 1999 ] ;
2: 12 1999 [ zwap
2: 1999 12 [ ' asdf  -13 THROW executed
2: 1999 12 [ -56 throw  -56 THROW executed
2: 1999 12 [ quit
FORTH> .s
  Data: 1999 12 ---
System: ---
Float: --- ok
FORTH> . . 12 1999  ok
FORTH> vb
0: [ abort  -1 THROW executed
0: [ true abort" hello"  -14 THROW executed
0: [ : test true abort" hello" ;
0: [ test  -2 THROW executed
0: [ quit
FORTH> .s
  Data: ---
System: ---
Float: --- ok
*)
ENDDOC

Date Sujet#  Auteur
27 Mar 25 * "The Best Programming Language for the End of the World"198Alexis
27 Mar 25 +* Re: "The Best Programming Language for the End of the World"5Martin Nicholas
28 Mar 25 i`* Re: "The Best Programming Language for the End of the World"4Alexis
28 Mar 25 i `* Re: "The Best Programming Language for the End of the World"3Martin Nicholas
30 Mar 25 i  +- Re: "The Best Programming Language for the End of the World"1Alexis
30 Mar 25 i  `- Re: "The Best Programming Language for the End of the World"1Bernd Linsel
28 Mar 25 +* Re: "The Best Programming Language for the End of the World"7anthk
29 Mar 25 i`* Re: "The Best Programming Language for the End of the World"6mhx
29 Mar 25 i +- Re: "The Best Programming Language for the End of the World"1dxf
30 Mar 25 i +* Re: "The Best Programming Language for the End of the World"3anthk
5 Apr 25 i i+- Re: "The Best Programming Language for the End of the World"1anthk
6 Apr 25 i i`- Re: "The Best Programming Language for the End of the World"1sjack
31 Mar 25 i `- Re: "The Best Programming Language for the End of the World"1John Ames
30 Mar 25 +* Re: "The Best Programming Language for the End of the World"86sjack
1 Apr 25 i`* Re: "The Best Programming Language for the End of the World"85dxf
29 Apr 25 i `* Re: Why dial-a-standard is not a thing in Forth84Hans Bezemer
30 Apr 25 i  +* Re: Why dial-a-standard is not a thing in Forth80dxf
30 Apr 25 i  i+* Re: Why dial-a-standard is not a thing in Forth77Hans Bezemer
1 May 25 i  ii`* Re: Why dial-a-standard is not a thing in Forth76dxf
1 May 25 i  ii +* Re: Why dial-a-standard is not a thing in Forth3John Doe
1 May 25 i  ii i+- Re: Why dial-a-standard is not a thing in Forth1Stephen Pelc
1 May 25 i  ii i`- Re: Why dial-a-standard is not a thing in Forth1Anton Ertl
1 May 25 i  ii `* Re: Why dial-a-standard is not a thing in Forth72Hans Bezemer
2 May 25 i  ii  +- Re: Why dial-a-standard is not a thing in Forth1dxf
3 May 25 i  ii  `* Re: Why dial-a-standard is not a thing in Forth70dxf
3 May 25 i  ii   +* QUIT and ABORT (was: Why dial-a-standard is not a thing in Forth)68Anton Ertl
3 May 25 i  ii   i+- Re: QUIT and ABORT1dxf
3 May 25 i  ii   i+* Re: QUIT and ABORT65dxf
3 May 25 i  ii   ii`* Re: QUIT and ABORT64Anton Ertl
4 May 25 i  ii   ii +* Re: QUIT and ABORT62dxf
4 May 25 i  ii   ii i`* Re: QUIT and ABORT61Anton Ertl
5 May 25 i  ii   ii i +- Re: QUIT and ABORT1dxf
5 May 25 i  ii   ii i +* Re: QUIT and ABORT54dxf
5 May 25 i  ii   ii i i`* Re: QUIT and ABORT53Ruvim
5 May 25 i  ii   ii i i +- Re: QUIT and ABORT1Ruvim
6 May 25 i  ii   ii i i +* Re: QUIT and ABORT3dxf
6 May 25 i  ii   ii i i i+- Re: QUIT and ABORT1Anton Ertl
6 May 25 i  ii   ii i i i`- Re: QUIT and ABORT1Ruvim
6 May 25 i  ii   ii i i `* Re: QUIT and ABORT48dxf
6 May 25 i  ii   ii i i  +* Re: QUIT and ABORT3Ruvim
6 May 25 i  ii   ii i i  i+- Re: QUIT and ABORT1Anton Ertl
6 May 25 i  ii   ii i i  i`- Re: QUIT and ABORT1dxf
6 May 25 i  ii   ii i i  `* Re: QUIT and ABORT44Anton Ertl
6 May 25 i  ii   ii i i   `* Re: QUIT and ABORT43dxf
7 May 25 i  ii   ii i i    `* Re: QUIT and ABORT42Ruvim
8 May 25 i  ii   ii i i     +* Re: QUIT and ABORT40dxf
8 May 25 i  ii   ii i i     i`* Re: QUIT and ABORT39Ruvim
9 May 25 i  ii   ii i i     i `* Re: QUIT and ABORT38dxf
9 May 25 i  ii   ii i i     i  `* Re: QUIT and ABORT37Ruvim
9 May 25 i  ii   ii i i     i   `* Re: QUIT and ABORT36dxf
9 May 25 i  ii   ii i i     i    +* Re: QUIT and ABORT2albert
10 May 25 i  ii   ii i i     i    i`- Re: QUIT and ABORT1dxf
9 May 25 i  ii   ii i i     i    `* Re: QUIT and ABORT33Ruvim
10 May 25 i  ii   ii i i     i     +- Re: QUIT and ABORT1dxf
13 May 25 i  ii   ii i i     i     `* Re: QUIT and ABORT31Ruvim
14 May 25 i  ii   ii i i     i      `* Re: QUIT and ABORT30dxf
14 May 25 i  ii   ii i i     i       `* Re: QUIT and ABORT29Ruvim
15 May 25 i  ii   ii i i     i        `* Re: QUIT and ABORT28dxf
16 May 25 i  ii   ii i i     i         `* Re: QUIT and ABORT27Ruvim
16 May 25 i  ii   ii i i     i          `* Re: QUIT and ABORT26dxf
16 May 25 i  ii   ii i i     i           `* Re: QUIT and ABORT25Ruvim
17 May 25 i  ii   ii i i     i            `* Re: QUIT and ABORT24dxf
17 May 25 i  ii   ii i i     i             `* Re: QUIT and ABORT23Ruvim
17 May 25 i  ii   ii i i     i              `* Re: QUIT and ABORT22dxf
17 May 25 i  ii   ii i i     i               `* Re: QUIT and ABORT21Ruvim
18 May 25 i  ii   ii i i     i                `* Re: QUIT and ABORT20dxf
18 May 25 i  ii   ii i i     i                 +* Re: QUIT and ABORT2Anton Ertl
18 May 25 i  ii   ii i i     i                 i`- Re: QUIT and ABORT1dxf
18 May 25 i  ii   ii i i     i                 `* Re: QUIT and ABORT17Ruvim
18 May 25 i  ii   ii i i     i                  `* Re: QUIT and ABORT16dxf
19 May 25 i  ii   ii i i     i                   `* Re: QUIT and ABORT15Ruvim
20 May 25 i  ii   ii i i     i                    `* Re: QUIT and ABORT14dxf
24 May 25 i  ii   ii i i     i                     `* Re: QUIT and ABORT13Ruvim
24 May 25 i  ii   ii i i     i                      +* Re: QUIT and ABORT7mhx
24 May 25 i  ii   ii i i     i                      i+* Re: QUIT and ABORT5Ruvim
24 May 25 i  ii   ii i i     i                      ii`* Re: QUIT and ABORT4mhx
24 May 25 i  ii   ii i i     i                      ii +- Re: QUIT and ABORT1Ruvim
24 May 25 i  ii   ii i i     i                      ii +- Re: QUIT and ABORT1Anton Ertl
24 May 25 i  ii   ii i i     i                      ii `- Re: QUIT and ABORT1albert
24 May 25 i  ii   ii i i     i                      i`- Re: QUIT and ABORT1Anton Ertl
24 May 25 i  ii   ii i i     i                      +- Re: QUIT and ABORT1albert
24 May 25 i  ii   ii i i     i                      `* Re: QUIT and ABORT4dxf
24 May 25 i  ii   ii i i     i                       `* Re: QUIT and ABORT3Ruvim
25 May 25 i  ii   ii i i     i                        `* Re: QUIT and ABORT2dxf
26 May 25 i  ii   ii i i     i                         `- Re: QUIT and ABORT1dxf
8 May 25 i  ii   ii i i     `- Re: QUIT and ABORT1Ruvim
5 May 25 i  ii   ii i `* Re: QUIT and ABORT5mhx
6 May 25 i  ii   ii i  +- Re: QUIT and ABORT1dxf
7 May 25 i  ii   ii i  `* Re: QUIT and ABORT3albert
7 May 25 i  ii   ii i   `* Re: QUIT and ABORT2minforth
7 May 25 i  ii   ii i    `- Re: QUIT and ABORT1dxf
4 May 25 i  ii   ii `- Re: QUIT and ABORT1dxf
4 May 25 i  ii   i`- Re: QUIT and ABORT (was: Why dial-a-standard is not a thing in Forth)1albert
5 May 25 i  ii   `- Re: Why dial-a-standard is not a thing in Forth1dxf
30 Apr 25 i  i`* Re: Why dial-a-standard is not a thing in Forth2sjack
1 May 25 i  i `- Re: Why dial-a-standard is not a thing in Forth1dxf
30 Apr 25 i  `* Re: Why dial-a-standard is not a thing in Forth3albert
30 Apr 25 i   `* Re: Why dial-a-standard is not a thing in Forth2Hans Bezemer
30 Apr 25 i    `- Re: Why dial-a-standard is not a thing in Forth1mhx
4 Apr 25 +- Re: "The Best Programming Language for the End of the World"1dxf
5 Apr 25 `* Re: "The Best Programming Language for the End of the World"98dxf

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal