On Mar 5, 6:25 pm, Ian Osgood <i...@[EMAIL PROTECTED]
> wrote:
> Unlike C's for loop, DO assumes the start is strictly less than the
> limit.
Unlike C's for loop, ``DO'' is written for a actual computer modulo
arithmetic, where +1 will always eventually bring any arbitrary
integer into agreement with any other arbitrary integer.
If you want ( 0 0 ) to step through every integer, you use ``DO LOOP''
and if you want ( 0 0 ) to not step through any, you use ``?DO LOOP''.
IOW, normal Forth ... tell the machine what you want it to DO, and it
will DO it, without trying to second-guess you.
What was broken in this example was the original code, where not
stepping through any integers for ( 0 0 ) would be desired, yet the
code said ``DO''.
Of course, as a learning exercise, the experience would have been
clearer in a 16-bit Forth, since 2^16 stars are more likely to
complete with the placid "OK" at the end before the person aborts than
2^32 stars. On an 80-column text monitor, that would be 819 full lines
of stars before the partial line with the ``OK''.


|