home bbs files messages ]

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 116,291 of 117,927   
   Ruvim to Ruvim   
   Re: Test cases for quotations   
   10 Mar 24 18:49:12   
   
   From: ruvim.pinka@gmail.com   
      
   On 2024-03-07 18:44, Ruvim wrote:   
   > On 2024-03-07 16:29, Ruvim wrote:   
   >> The accepted proposal for quotations [1] specifies only compilation   
   >> semantics for the words "[:" and ";]".   
   >>   
   [...]   
   >>   
   >>   
   >> ===== start of "quotation.test.fth"   
   >>   
   >> \ Test cases for quotations "[: ... ;]"   
   >>   
   >>   
   >>   
   >> \ Testing the compilation semantics   
   >>   
   >> \ t11   
   >> t{ :noname [: 123 ;] ; execute execute -> 123 }t   
   >>   
   >> : lit, postpone literal ;   
   >> : ([:) postpone  [: ;   
   >> : (;]) postpone  ;] ;   
   >>   
   >> \ t12   
   >> t{ :noname  [ ([:) (;]) ]  ;  0<>  ->  -1  }t  > \ t13   
   >> t{ :noname 1 [ ([:) 2 lit, (;]) ] 3 ; execute swap execute -> 1 3 2 }t   
   >>   
   >   
   > t12 roughly tests that the compilation semantics for the words "[:" and   
   > ";]" can be correctly performed programmatically.   
   >   
   > This test fails in Gforth, VfxForth, minForth.   
   >   
   > The problem is that the system enters compilation state after executing   
   > "([:)". But it shall not. This action cannot be a part of compilation   
   > semantics at all (it's not possible to correctly specify this action,   
   > and it is not actually specified for the "[:" compilation semantics).   
   >   
   > The reason of the problem is that "postpone" is implemented not quite   
   > correctly in these systems. After including a polyfill for "postpone"   
   > [2], the tests t12 and t13 are passed in Gforth.   
   >   
   > VfxForth (5.20 Alpha 1 [build 4065]) and minForth (V3.4.8) provide   
   > neither "find-name" nor correct "find", so "postpone" cannot be   
   > correctly defined by the polyfill.   
      
      
   In minForth, "[:" leaves some data on the return stack, and ";]"   
   consumes this data from the return stack (contrary to the   
   specification). So, it fails in the following test case:   
      
   t{ : [t14] ( -- ) 123 >r ([:) r> lit, (;]) ; immediate -> }t   
   t{ :noname [t14] ; execute execute -> 123 }t   
      
      
   --   
   Ruvim   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca