ins=: 1 : '(-m)|.,'
_1 (3) ins 1 2 3
1 2 3 _1
_1 (0) ins 1 2 3
_1 1 2 3
_1 (1) ins i.3 4
8 9 10 11
_1 _1 _1 _1
0 1 2 3
4 5 6 7
--- Fuchs Ira <[EMAIL PROTECTED]> 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?
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
>
____________________________________________________________________________________
Choose the right car based on your needs. Check out Yahoo! Autos new Car
Finder tool.
http://autos.yahoo.com/carfinder/
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm