Rebol [ Title: "Cfor" File: %cfor.r Author: "Ladislav Mecir" Date: 27-Jun-2005/8:22:28+2:00 History: [ 13/Dec/2002/8:30 {using INC block} 27-Jun-2005/8:22:28+2:00 {using #include} ] Purpose: {General loop for REBOL} ] #include %set-words.r comment [ Example: ; Instead of incrementing the cycle variable you can e.g. double it ; much faster than the R2 Core FOR cfor [num: 0] [num <= 30] [num: num + 1] [ if num = 15 [recycle] print num ] cfor [i: 1] [i <= 2000] [i: i + i] [print i] ] cfor: func [ {General loop} [throw] init [block!] test [block!] inc [block!] body [block!] ] [ use set-words init reduce [ :do init :while test head insert tail copy body inc ] ]