Brian Schott, there were two examples in wikipedia:
   4 ms1 14
19.5 10.3562
   6 ms1 14
16.25 3.49106

Bill Lam, your code works perfectly. I think it is on the path to tacit 
programming, even if it is not easy to read.

Thanks a lot for the answers.
Bo



--- Den tors 30/7/09 skrev bill lam <[email protected]>:

> Fra: bill lam <[email protected]>
> Emne: Re: [Jprogramming] a hook problem
> Til: [email protected]
> Dato: torsdag 30. juli 2009 16.25
> On Thu, 30 Jul 2009, Bo Jacoby
> wrote:
> > Then I make a dyadic verb, ms1, computing mu,sigma 
> >    ms1 =. 4 : 'm,%:((*/y-1 2)*%/x-1
> 3)+(*-.)m=.(y-1)*%/x-1 2'
> > test:
> >    6 ms1 14
> > 16.25 3.49106
> > 
> > When I try to simplify by the hook (m,f m) === (,f)m
> >    ms2 =. 4 : '(,(%:((*/y-1 2)*%/x-1
> 3)+(*-.)))(y-1)*%/x-1 2'
> 
> rewrite it into
>        m,  %: @: ( ((*/y-1 2)*%/x-1 3) +
> (*-.) )  m
>                
>    ..................
>                
>    a constant verb 
>    +  hook 
>                
>                
>      fork
> 
> ms2 =. 4 : 'm , %: @: ( ((*/y-1 2)*%/x-1 3) + (*-.) )
> m=.(y-1)*%/x-1 2'
> 
> 
> then simplify by the hook (m,f m) === (,f)m
> 
>  ms2 =. 4 : '(, %: @: ( ((*/y-1 2)*%/x-1 3) + (*-.) ))
> (y-1)*%/x-1 2'
> 
> However isn't ms1 more comprehensible?
> 
> -- 
> regards,
> ====================================================
> GPG key 1024D/4434BAB3 2008-08-24
> gpg --keyserver subkeys.pgp.net --recv-keys 4434BAB3
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
> 


      ________________________________________________________ 
Audi, Fiat, Peugeot, Skoda, Porsche, Toyota, Ford - Kelkoo har brugte biler til 
en hver smag! Klik her for at sammenligne priser.(http://dk.yahoo.com/r/pat/mmb)
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to