[Jprogramming] Parameterizing in a recursion

Randy MacDonald ramacd at nbnet.nb.ca
Mon Jan 16 04:31:26 HKT 2006


What is this getting you that / isn't? It seems to be an illustration of how
reduce can be defined recursively. If that's all there is, that's actually
fine. I'm just wondering if there isn't more going on here.

-----------------------------------------------------------------------
|\/| Randy A MacDonald             | you can't pay for it,
|/\| ramacd at nbnet.nb.ca            |       even if you want to.
BSc(Math) UNBF'83 Sapere Aude      | APL: If you can say it, it's done..
Natural Born APL'er                | Demo website: http://142.166.105.166/
----------------------------------------------------(INTP)----{ gnat }-

----- Original Message ----- 
From: "Erling Hellenäs" <erling.hellenas at runbox.com>
To: "'Programming forum'" <programming at jsoftware.com>
Sent: Sunday, January 15, 2006 3:58 PM
Subject: RE: [Jprogramming] Parameterizing in a recursion


> Hi all !
>
> Another way to express it:
>
>    reduce=: 1 : 'u./`({. u. [: $: }. )@.(0: < #)'
>    +reduce 1 2 3
> 6
>    *reduce 4 5 6
> 120
>    +reduce
> +/`({. + [: $: }.)@.(0: < #)
>
> Cheers,
>
> Erling Hellenäs
>
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm




More information about the Programming mailing list