Greetings,

Going through J I found that:

   x=:1+i.5
   x
1 2 3 4 5
   44 (2}) x
1 2 44 4 5
   x
1 2 3 4 5

It seems that J doesn't actually make an indexed assignment.  It seems
more like it creates a copy of the array with the specified
modifications.  This is actually quite shocking.  Index assignment to
a very large array in most languages is a very fast and simple
operation.  It is also very memory efficient.  Creating a modified
copy of a very large array has a much, much greater time and space
cost.  Further, multiplying this (unnecessary) cost over a great
number of operations can drastically (and unnecessarily) affect
performance negatively.

Am I missing something here?

Thanks.

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

Reply via email to