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