Hi

First off, your example h is not using the primitives monadically as the
following shows:

   h=:+`^
   h/ 3,4,5
1027

   3 + 4 ^ 5  NB. each operand is used dyadically
1027

Your second example can be effected by defining:

   g=:-:@*:@+:  NB. halve the square after doubling
   g 1 2 3
2 8 18

Is that what you're looking for?



> Date: Fri, 30 Jan 2009 16:28:43 +0000
> From: [email protected]
> To: [email protected]
> Subject: [Jprogramming] gerrunds
> 
> Hi,
> I was hoping to make a gerund apply itself monadically to each element of an
> array similar to the insert example
> 
>    h=:+`^
>    h/ 3,4,5
> 1027
> 
> 
>    g=:+:`*:`-:
>    g 1 2 3
> |syntax error
> |       g 1 2 3
> 
> 
> I also tried vectorising:
> 
>    g...@.(i.3) 1 2 3
> |domain error
> |       g...@.(i.3)1 2 3
> 
> 
> Is this possible without a loop?
> 
> 
> Steven
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm

_________________________________________________________________
Twice the fun—Share photos while you chat with Windows Live Messenger. Learn 
more.
http://www.microsoft.com/uk/windows/windowslive/products/messenger.aspx
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to