If the loop uses the last thing calculated as input to the next time through, you could do something like:
something^:100 ] initialValue where "initialValue" is the initial value fed to the loop. On Thu, Aug 28, 2008 at 4:48 PM, Raul Miller <[EMAIL PROTECTED]> wrote: > On Thu, Aug 28, 2008 at 4:43 PM, Leigh J. Halliwell > <[EMAIL PROTECTED]> wrote: > > 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. > > I would test and see -- but I expect that you probably would not notice > much difference if you're doing anything significant inside that loop. > > Also note that you can use > for.i.100 do. > do something > end. > > And you can also use anonymous functions. > 3 :'do something'"0 i. 100 > > Finally note that the function will return 100 values > where the loop would only return the last value. > > -- > Raul > ---------------------------------------------------------------------- > For information about J forums see http://www.jsoftware.com/forums.htm > -- Devon McCormick, CFA ^me^ at acm. org is my preferred e-mail ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
