Forums before death by AOL, social media and spammers... "We can't have nice things"
|    comp.lang.forth    |    Forth programmers eat a lot of Bratwurst    |    117,927 messages    |
[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]
|    Message 117,300 of 117,927    |
|    Ruvim to dxf    |
|    Re: QUIT and ABORT    |
|    06 May 25 11:23:19    |
   
   From: ruvim.pinka@gmail.com   
      
   On 2025-05-06 05:33, dxf wrote:   
   > 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   
      
   I see, your idea is to specially handle -56 only when there is no user   
   exception frame.   
      
   A difference is that the following command:   
      
    echo -e "999 -56 throw \n cr depth . bye" | forth   
      
   shall print "0" at the end, and you suggest it to print "1".   
      
   Note that this does not affect the behavior of `quit` anyway, and your   
   result of interpreting the line with `bar` in a citation below is still   
   non-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).   
   >   
   > 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   
   >   
      
   `abort` 9.6.2.0670 is *specified* to behave this way, but `quit`   
   6.1.2050 is not.   
      
      
   --   
   Ruvim   
      
   --- SoupGate-DOS v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   
|
[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]
(c) 1994, bbs@darkrealms.ca