Remember, assignment-in-place is better for large arrays.

Henry Rich

On 3/26/2015 12:37 AM, David Lambert wrote:
The UnderFrom adverb evaluates verb u on x{y and replaces x{y with the
result.  (In c, array notation y[x] = u(y[x]) What problems ensue from
implementing an obverse to from?


    UnderFrom =: (@:{)(`[)(`])}

    3 ^.UnderFrom i._8   NB. ln of the fourth item
7 6 5 1.38629 3 2 1 0


    NB. under from
    3 ^.&.{ i._8
|domain error
|   3    ^.&.{i._8


    ^.&.(3&{) i._8
|index error
|       ^.&.(3&{)i._8


I hope this is a better idea than the marginally useful global `for'
assignment which I would occasionally use to debug.  for_i: do. end.
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

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

Reply via email to