How to re-evaluate an expression in J?

Given the following expression in J, how to execute it ntimes?

6?99

The only solution I could come up with is to turn it into a verb that works well, but I suspect the best way:

(3 : '6?99')"0 i.100

Now, before anyone gets confused, this question is not about a specific expression 6?99. This is a general question about the programming language J. Your answer should be general enough to apply to any J-expression, not just to 6?99.

+6
source share
1 answer

Still turning it into a verb, but this time silently

   (6 ? 99"_)"0 i.4
92 61 82  7 67 12
56 76 77 67  9 24
16 31  9 76 70 98
65 24  2 28  1 39

Depending on the verb, this may be a little cleaner than explicit.

- , , , ?

   n=.4
   6 ? n $ 99
43 55 79 71 35 33
41 56 67  3 78 24
38 34  7 61 14 13
95 63 43 47 73 29
+3

All Articles