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,657 of 117,927   
   Gerry Jackson to All   
   Re: Conditional compilation   
   31 Oct 25 16:28:21   
   
   From: do-not-use@swldwa.uk   
      
   Sorry Anton I read your message and was going to reply and I   
   accidentally did something that caused Thunderbird to lose your message.   
   I can't find it and it isn't in the 'deleted' folder. I'd be grateful if   
   you could repost it please.   
      
    From my memory the gist of your message was:   
   given   
      
   my-condition [if]   
   \  I have something witty to say about [if]   
         ....   
   [else]   
         ....   
   [then]   
      
   I think you said that if MY-CONDITION is TRUE then the first [if] let's   
   the Forth interpreter take over and so the second [IF] is ignored   
   because it's in a comment and all is good   
      
   But if MY-CONDITION is FALSE the second [IF] is reached with unknown   
   consequences.   
      
   With my extension to Ruvim's reference implementation I have inserted   
   : \  postpone \  ;   
   in the BRACKET-FLOW-WL wordlist (which I hate typing so I'll use the   
   abbreviation BFWL) so when the condition is false the sequence is:   
   - The Forth WL [IF] is executed and consumes the false flag to call the   
   Forth WL [ELSE]   
   - After a refill this [ELSE] parses the \ at the start of the next line   
   - it then searches the BFWL, finds \ and executes it to ignore the rest   
   of the line including the second [IF]   
   - after another REFILL the Forth [ELSE] parses and executes the BFWL   
   [ELSE] with 1 on the stack and returns 0 which cause the Forth [ELSE] to   
   exit and return control to the Forth interpreter.   
      
   An example worked so I don't see how the second [if] is ever found and   
   executed.   
      
   Or are you saying that the second [if] should be found because that is   
   what is expected in a standard by the Forth standard   
      
   Or have I missed some nuance in your message?   
   I remember a comment about ." but don't remember anything else   
      
   --   
   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