26 lines
532 B
Plaintext
26 lines
532 B
Plaintext
print "---------------------------"
|
|
print "As a loop"
|
|
print "---------------------------"
|
|
loop 4 'x ->
|
|
print "Example 1"
|
|
|
|
repeatFunc: function [f,times][
|
|
loop times 'x ->
|
|
do f
|
|
]
|
|
|
|
print "---------------------------"
|
|
print "With a block param"
|
|
print "---------------------------"
|
|
repeatFunc [print "Example 2"] 4
|
|
|
|
repeatFunc: function [f,times][
|
|
loop times 'x ->
|
|
f
|
|
]
|
|
|
|
print "---------------------------"
|
|
print "With a function param"
|
|
print "---------------------------"
|
|
repeatFunc $[][print "Example 3"] 4
|