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 117,646 of 117,927   
   Gerry Jackson to dxf   
   Re: Conditional compilation   
   26 Oct 25 14:10:07   
   
   From: do-not-use@swldwa.uk   
      
   On 25/10/2025 12:36, dxf wrote:   
   > Put the following into a file and then load it:   
   >   
   > 1   
   >   
   > 0 [IF]   
   >   
   > 2   
   >   
   > 0 [IF]   
   >   
   > 3   
   >   
   > [THEN]   
   >   
   > .S   
   >   
   >   
   > I'm stunned at how many forths won't handle it.  Caught me by surprise.   
      
   Using the implementation in the standard there are a few strange   
   behaviours with [if] e.g putting the above into 1 line for convenience   
      
   1 0 [if] 2 0 [if] 3 [then] \ this [then] .s \ ought to be ignored   
      
   In all Forths I tried the [then] in the comment is found by the first   
   [if] control starts interpreting and displays 1 so that the "ought to be   
   ignored" has to be commented out.   
      
   Also:   
      
   [else] can be used as a   
   multi-line comment [then]   
      
   --   
   Gerry   
      
   --- 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