[Jprogramming] A q for starters - composing without forking (% +/ %)

Devon McCormick devonmcc at gmail.com
Fri Feb 5 07:38:26 HKT 2010


Caps also appear if you generate a tacit expression using "13 :" e.g.

   13 : '%+/%y'
[: % [: +/ %
   (13 : '%+/%y') 10 20 40
5.7142857
   ([: % [: +/ %) 10 20 40
5.7142857

I like the dual version for this because it's conceptually closer to what is
probably intended by "the inverse of the sum of the inverses" i.e. when
calculating the harmonic mean.

On Thu, Feb 4, 2010 at 5:56 PM, Alex Gian <alexgian at blueyonder.co.uk> wrote:

>
> ...  Cap ( [: ) looks cool too, but I haven't encountered a
> similar construct before.  E.g.  I can't intuitively see why Ric's
> suggestion ( [: % [: +/ % ) isn't ( [: % [: +/ [: % ), guess I'll just
> have to rtfm.
> ...
>  ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
>



-- 
Devon McCormick, CFA
^me^ at acm.
org is my
preferred e-mail


More information about the Programming mailing list