Although the definition is a string of characters, you really need to think
of it as a string of J words.

    ;:'g=: (%):*'
+-+--+-+-+--+-+
|g|=:|(|%|):|*|
+-+--+-+-+--+-+

Notice that the right paren and colon are grouped as a word. So the parens
are not balanced and the word ): is not a valid primitive.

On Fri, Oct 28, 2011 at 3:39 AM, Linda Alvord <[email protected]>wrote:

>
>
> That was easy,  Thanks  Linda
>
> -----Original Message-----
> From: [email protected]
> [mailto:[email protected]] On Behalf Of Markus
> Schmidt-Gröttrup
> Sent: Friday, October 28, 2011 5:33 AM
> To: Programming forum
> Subject: Re: [Jprogramming] Monad - Dyad
>
> A space is needed: Just define
>
>       g =: %  :  *
>       g  3
> 0.333333
>       4 g 5
> 20
>
> Greetings, Markus
>
>
> Am 28.10.2011 11:23, schrieb Linda Alvord:
> > How can I define a function to test   :  used as  Monad/Dyad ?
> >
> >
> >
> >       ]a=:?i.10
> >
> > 0.434701 0 1 1 1 1 0 6 6 6
> >
> >      ]b=:?i.10
> >
> > 0.0736612 0 0 2 3 2 3 0 7 2
> >
> >     *a
> >
> > 1 0 1 1 1 1 0 1 1 1
> >
> >     *b
> >
> > 1 0 0 1 1 1 1 0 1 1
> >
> >      %a
> >
> > 2.30043 _ 1 1 1 1 _ 0.166667 0.166667 0.166667
> >
> >     %b
> >
> > 13.5757 _ _ 0.5 0.333333 0.5 0.333333 _ 0.142857 0.5
> >
> >       f=: %:*
> >
> >      f
> >
> > %: *
> >
> >    g=: (%):*
> >
> > |spelling error
> > | g=: (%):*
> > | ^
> >
> >
> >
> > Linda
> >
> >
> >
> > ----------------------------------------------------------------------
> > For information about J forums see http://www.jsoftware.com/forums.htm
> >
> >
>
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
>
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
>
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to