Executes given body
word/quotation n
times. In each iteration pushes current counter on d-stack prior to executing body.
Non-HOF version of {@link loop}. Expects test result and body quotation / word on d-stack.
( testq bodyq -- ? )
-
Generated using TypeDoc
Higher order word. Takes a
test
andbody
stack program. Applies test to copy of TOS and executes body. Repeats while test is truthy.( -- ? )
run([loop([dup, ispos], [dup, print, dec])], [[3]]) // 3 // 2 // 1 // [ true, [ 0 ], undefined ]