Dear J Forum:
 
Suppose that I wanted to run some code 100 times.  I could use control
statements:
 
n =. 0
while. n < 100 do.
. code goes here .
n =. >: n
end.
 
Or I could enclose the code within a monadic function with a dummy argument
and execute:
 
code_function i. 100
or possibly
code_function"0 i. 100
 
Disliking loops, I prefer the second option.  However, I also dislike
creating unnecessary functions.  So I see merit to both ways.
 
My question is whether J's built-in looping will more quickly execute the
the second way.  Are control statements bound to run more slowly?  Thanks.
 
Sincerely, 

Leigh 
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to