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,656 of 117,927   
   Anton Ertl to Gerry Jackson   
   Re: Conditional compilation   
   31 Oct 25 14:35:24   
   
   From: anton@mips.complang.tuwien.ac.at   
      
   Gerry Jackson  writes:   
   >> - never comment out conditional compilation.   
   >   
   >Why? I've shown that it can be done using \, that means that any use of   
   >[IF] etc in the rest of the comment line is not executed   
      
   But the [IF] in the comment may be considered to be active code rather   
   than a comment by an outside [IF] or [ELSE].   
      
   Consider   
      
   my-condition [if]   
   \ here I have something witty to say about [IF]   
   ...   
   [else]   
   ...   
   [then]   
      
   If MY-CONDITION is true, this will work as intended.  If MY-CONDITION   
   is false, the [IF] in the comment will be perceived as starting an   
   [IF] ... [ELSE] ... [THEN] block, and the [ELSE] and the [THEN] will   
   be perceived as belonging to it.   
      
   So commenting out parts of conditional compilation has its pitfalls.   
      
   Commenting out a complete [IF]...[THEN] or [IF]...[ELSE]...[THEN]   
   block should do ok.   
      
   Note that other parsing words have similar bad effects:   
      
   my-condition [if]   
     ." in the [IF] branch"   
   [else]   
     ." in the [ELSE] branch"   
   [then]   
      
   Depending on my-condition, this will have ... interesting effects.   
      
   - anton   
   --   
   M. Anton Ertl  http://www.complang.tuwien.ac.at/anton/home.html   
   comp.lang.forth FAQs: http://www.complang.tuwien.ac.at/forth/faq/toc.html   
        New standard: https://forth-standard.org/   
   EuroForth 2025 CFP: http://www.euroforth.org/ef25/cfp.html   
   EuroForth 2025 registration: https://euro.theforth.net/   
      
   --- 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