larsbrinkhoff / lbForth

Self-hosting metacompiled Forth, bootstrapping from a few lines of C; targets Linux, Windows, ARM, RISC-V, 68000, PDP-11, asm.js.
GNU General Public License v3.0
414 stars 113 forks source link

Throw out DO-LOOP #57

Open larsbrinkhoff opened 7 years ago

larsbrinkhoff commented 7 years ago

Remove (LOOP) from nucleus. Replace uses of DO-LOOP with FOR-NEXT in the kernel. Provide DO-LOOP in a compatability layer.

https://www.reddit.com/r/Forth/comments/6b9lsz/alternatives_to_loop/

larsbrinkhoff commented 7 years ago

@lowfatcomputing brought up an intresting idea: Use HERE as the index inside the loop.

https://www.reddit.com/r/Forth/comments/6loglg/loops_that_can_be_factored_use_the_dictionary/