There's a question I'm tracking on Stack Overflow that I'm trying to solve:

https://stackoverflow.com/questions/49288689/how-to-amend-data-in-a-box-j-pr
ogramming

 

Given a multi-level box:

a =: 1 2 3 ; <4 ; < 5 6; <7 8

 

How to you amend something given an address multiple levels into the box,
e.g. the <5 6 part? I've tried some combination of S: and {:: and } however
I can't seem to crack it. I might have expected this to work:

 

(<123) (1;1;0)} a

 

However, in this example, the (1;1;0) replaces item 1 and 0, treating the
1;1;0 as the list of elements to amend, as opposed to the array index to be
amended, as is the case with (1;1;0) {:: a

 

Does this mean that J needs a new amend operator, something akin to:

 

(<123) (1;1;0) }:: a

 

?

 

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

Reply via email to