The verb is amend and the main issue is that you must separate  100 and 2 or
they become the list 100 2

      100 (2)} A=.i.5
0 1 100 3 4
      
      (100) 2} A=.i.5
0 1 100 3 4
   

Linda

-----Original Message-----
From: programming-boun...@forums.jsoftware.com
[mailto:programming-boun...@forums.jsoftware.com] On Behalf Of Roger Hui
Sent: Monday, September 08, 2014 10:21 AM
To: Programming forum
Subject: Re: [Jprogramming] Replace one item of a list

   a=: i.5
   a
0 1 2 3 4
   a=: 100 (2}) a
   a
0 1 100 3 4



On Mon, Sep 8, 2014 at 7:18 AM, Sebastian <seb_fo...@arcor.de> wrote:

> Hi,
>
> What is actually the best practice to replace one item of a list?
>
> The only way I know feels a bit complicated:
>
> a =: i. 5
> 0 1 2 3 4
>
>
>
> (2 {. a), 100, (3 }. a)
>
> 0 1 100 3 4
>
>
>
> Best regards,
>
> Sebastian
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
>
----------------------------------------------------------------------
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