gforth
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [gforth] FOR...NEXT


From: Anton Ertl
Subject: Re: [gforth] FOR...NEXT
Date: Sat, 23 Feb 2019 19:02:08 +0100
User-agent: NeoMutt/20170113 (1.7.2)

On Sat, Feb 23, 2019 at 03:38:45PM +0000, dch wrote:
> Why does FOR run n+1 times? It seems inane. `4 FOR ... NEXT` should not 
> run 5 times, that's absolutely ridiculous. Even Chuck's FOR loops ran n 
> times in Forth and n times in ColorForth. So there must be a good reason 
> for this.

Different Forths behave differently for FOR...NEXT:

gforth: n+1 iterations
iforth: n+1 iterations
bigforth: n+1 iterations
SwiftForth: for ?
VFX: for ?
lxf: n iterations

Because of that, I think that SwiftForth and VFX have the best
behaviour.  However, I guess that Gforth has inherited its FOR..NEXT
behaviour from bigForth.

- anton



reply via email to

[Prev in Thread] Current Thread [Next in Thread]