home .. forth .. colorforth mail list archive ..

Re: [Re: [colorforth] Dare I say ANS!]


Howerd,

FOR .. NEXT counts down from N to 0. Think of it like this:

: FOR ( -- a a ) (BEGIN) POSTPONE 1- (IF) SWAP ; IMMEDIATE
: NEXT ( a a -- ) (AGAIN) (THEN) ; IMMEDIATE

I don't really use colorForth, so I'm sure there are subtle differences to it
than the code above - I'm sure Samuel will correct it :) but it should give
you a good idea.

Jeff

"Howerd Oakford" <howerd.oakford@xxxxxxxxxxxx> wrote:

I like for ... next , and can happily live without do ... loop, but why does i
return 1 to n instead of 0 to n-1 ? I don't see how what i does affects the
loop itself...



---------------------------------------------------------------------
To unsubscribe, e-mail: colorforth-unsubscribe@xxxxxxxxxxxxxxxxxx
For additional commands, e-mail: colorforth-help@xxxxxxxxxxxxxxxxxx
Main web page - http://www.colorforth.com