Note also:

   dyad
4

That said, you can do it with verb:

   put =: verb : (':';'42 x}y')
   3 put 9$0
0 0 0 42 0 0 0 0 0

See also http://www.jsoftware.com/help/dictionary/d310n.htm

Thanks,

-- 
Raul

On Fri, Jun 23, 2017 at 6:17 AM, Schmidt-Gröttrup, Markus
<m.schmidt-groett...@hs-osnabrueck.de> wrote:
> Try
>
> put =: 4 : '42 (x)}y'
>
> verb is defined as 3, meaning a monadic verb, but a dyadic verb is needed.
>
> Best regards,
> Markus
>
> -----Ursprüngliche Nachricht-----
> Von: Programming [mailto:programming-boun...@forums.jsoftware.com] Im Auftrag 
> von Rudolf Sykora
> Gesendet: Freitag, 23. Juni 2017 11:24
> An: programm...@jsoftware.com
> Betreff: [Jprogramming] verb to set an element of an array
>
> Hello,
>
> I want to set x'th element of y to 42.
> I tried quite a few variations of
>
> put := verb : '42 x}y'
>
> but I am still getting
>
> 1 put 1 2 3
> |domain error: put
>
> Can you tell me what is wrong, and tell me how to do it right?
>
> Thanks
> Ruda
> ----------------------------------------------------------------------
> 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