On Mon, Oct 10, 2011 at 1:38 PM, David Vaughan
<purpleblue...@googlemail.com> wrote:
> Hi, I was curious about the space limit J has for its arrays, and ways this 
> can be worked around. In some cases, you may want to do something equivalent 
> to a loop in C that runs many many times, which I would only know to do in J 
> by listing all the items and then performing a verb on them. Is there any 
> other approach?

You can also use loops in J.

Best practice is probably to solve the problem for a small data set
and then arrange for it to be run in blocks on larger data sets.  If
you never need the larger data sets, the blocking can be ignored.  If
you do need them, then picking an appropriate block size (for example
with 10MB..100MB intermediate result sizes but perhaps with much
smaller blocks for testing purposes) becomes easy -- you already have
a working mechanism to test against.

In general, using small blocks will make block boundary and handling
errors visible, and will slow down the performance of the system.
That's good for testing, but bad for "real work".

That said, note that "loops" can also be replaced with "event
handlers" when the issue is responding to external activity.

That said, note that someone with a lot of experience in C coding (or
other scalar languages -- which is just about every language other
than SQL, these days) but little experience in J will tend to have
coding reflexes which tend to yield abysmal J code.  I remember making
those kinds of mistakes myself, when I was first learning J.

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

Reply via email to