aboutsummaryrefslogtreecommitdiff
path: root/amforth-6.5/common/lib/for-next.frt
blob: 8a29ebf881aec553d93ccf744498052ed5fb088c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
\ for/next is from colorforth
\ note that 0 and -1 are executable words, not numbers!
\
: for postpone 0
      postpone swap 
      postpone do
; immediate

: next
      postpone -1
      postpone +loop
; immediate

\ test case
\ : test 10 for i . next ;
\ prints
\ 10 9 8 7 6 5 4 3 2 1 0
\