At 11:42  -0400 2007/08/23, Fuchs Ira wrote:
Very elementary question:

Is there a primitive verb which will insert a value in a list? That is, given an index, a new value , and a list, the verb would insert the value in the list after the index location.

for example if a=:2 3 5 6 and I want to insert a 4 after in the 3rd position, I can say (2{.a) ,4 ,2}.a

Is there a primitive verb to do this? If not, what is the simplest definition for doing this?


Something similar that I always wanted as primitive was
satisfied by recent enhancement of I. - if you want know
where items "belong" in a, you can write

   a I. 4
2

As others have said, it would be useful to know more of
what you are trying to accomplish.
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to