Note that nc is typically defined as 4!:0 so redefining it might break
some code.
That said:
nc=. 1 : '[: >: u'
mnc=: {{ (`(m#<'nc'))(`:6) }}
+ 9 mnc 7
16
+ 9 mnc
[: >: [: >: [: >: [: >: [: >: [: >: [: >: [: >: [: >: +
9 mnc
(`(nc`nc`nc`nc`nc`nc`nc`nc`nc))(`:6)
I hope this makes sense...
--
Raul
On Mon, Jun 12, 2023 at 6:12 AM Martin Kreuzer <[email protected]> wrote:
>
> Dear all -
>
> Having used Fixed Power (u^:n y) before, I noticed that it works on
> the verb-adverb compound to its left.
>
> Let's have a simple, silly example:
>
> nc=. 1 : '[: >: u' NB. defining an adverb 'increase'
>
> +: i. nc 7 NB. which works fine
> 2 4 6 8 10 12 14
>
> Using Fixed Power like
>
> +: nc ^:1 (7)
> 15
> +: nc ^:2 (7)
> 31
>
> I do get the expected results (compound is executed once, twice).
>
> Here we have a verb, followed by two adverbs (if I understand correctly).
>
> What I have initially been looking for however, is how to apply the
> *same* adverb repeatedly, like
>
> +: nc nc (7)
> 16
>
> while having the adverb part "nc nc" somehow abbreviated.
>
> What would be a (or the) way to phrase that ?
>
> Thanks.
> -M
>
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm