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,307 of 117,927   
   albert@spenarnc.xs4all.nl to All   
   My take on DO, was Re: push for memory s   
   13 Mar 24 14:30:00   
   
   - DOxxx performs the loop   
   - Indices are integers.   
   - forms of DO   
      one-bound {BODY} DO)     \ 0 ... one-bound-1   
      one-bound {BODY} DO]     \ 1 ... one-bound   
      b1 b2 {BODY} DO[]    \ b1 .. b2   
      b1 b2 stride {BODY} DO[..]  \ b1 b1+stride b1+2*stride .. b2   
      
   Maybe   
      b1 b2 {BODY} DO[)    \ b1 .. b2-1   
   to accommodate   
      array length OVER + {BODY} DO[)   
      
   Note the stride is now constant obviously.   
   If it is negative, the loop goes down.   
   If you want to straddle from positive to negative (addresses?),   
   program it explicitly and conspicuously.   
      
   Note 1   
   The [ ) convention comes from mathematics, example:   
   [1,9] interval 1 2 3 4 5 6 7 8 9   
   [1,9) interval 1 2 3 4 5 6 7 8   
   (0,9) interval 1 2 3 4 5 6 7 8   
      
   Note 2   
   {BODY} leans heavily on [: ;] presence. (Or ciforth's { } )   
      
   Note 3   
   If you want to change the stride mid-program, you have to   
   use BEGIN WHILE REPEAT, as you should have done in the first place.   
      
   The four DO's replace the four don't's : ?DO DO LOOP +LOOP .   
      
   Groetjes Albert   
   --   
   Don't praise the day before the evening. One swallow doesn't make spring.   
   You must not say "hey" before you have crossed the bridge. Don't sell the   
   hide of the bear until you shot it. Better one bird in the hand than ten in   
   the air. First gain is a cat purring.            - the Wise from Antrim -   
      
   --- 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