foo0=: 3 : '0'
   foo1=: 3 : '1'
   foo2=: 3 : '2'
   foo3=: 3 : '3'

   allfoo=: foo2,foo3
   allfoo=: foo1,foo2,allfoo_:

   allfoo
foo0 , foo1 , foo2 , foo3
   allfoo''
0 1 2 3

I hope this helps,

-- 
Raul


On Sat, Apr 2, 2022 at 1:42 PM Devon McCormick <devon...@gmail.com> wrote:
>
> Hi,
> I have a group of monadic verbs for which I want the concatenated result,
> e.g.
>   foo0=: 3 : '0'
>    foo1=: 3 : '1'
>    foo2=: 3 : '2'
>    foo3=: 3 : '3'
>    allfoo=: foo0,foo1,foo2,foo3
>    allfoo ''
> 0 1 2 3
>
> So *allfoo* does what I want.  However, my actual set of verbs is longer
> than this so I broke the assignment of *allfoo* into two pieces for
> readability:
>    allfoo=: foo0,foo1
>    allfoo=: allfoo,foo2,foo3
>    allfoo
> allfoo , foo2 , foo3
>    allfoo ''
> |stack error: foo3
> |allfoo[0]
>
> I have inadvertently introduced infinite recursion.  Clearly I'm missing
> something thinking I can concatenate verbs like I can concatenate nouns.
>
> This gives me a result that performs as expected but looks bad:
>    allfoo=: foo0,foo1
>    allfoo=: (allfoo f.),foo2,foo3
>    allfoo''
> 0 1 2 3
>    allfoo
> (3 : (,'0') , 3 : (,'1')) , foo2 , foo3
>
> Any suggestions on how to break the assignment into multiple lines?
>
> Thanks,
>
> Devon
>
>
>
> --
>
> Devon McCormick, CFA
>
> Quantitative Consultant
> ----------------------------------------------------------------------
> 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