I​
f you want to define a tacit definition as monadic or dyadic only​, simply
use [: for that part of the definition. The definition I had for Jos was
yours but with [: for the modadic use to make it give an error when used
monadically instead of returning a nonsense result.


On Thu, May 9, 2013 at 7:23 AM, Linda Alvord <[email protected]>wrote:

> Here is the definition I was using:
>
>    Jos=:(1 }. ] |.~ [: <: [)^:(1 < [: # ])^:_ [: i. ]
>    Jos 12
> 10
>    4 Jos 38
> 37
>
> Linda
>
> -----Original Message-----
> From: [email protected]
> [mailto:[email protected]] On Behalf Of Don Guinn
> Sent: Thursday, May 09, 2013 8:11 AM
> To: Programming forum
> Subject: Re: [Jprogramming] rosettacode
>
>    Jos=:[: : ((1 }. ] |.~ [: <: [)^:(1 < [: # ])^:_ [: i. ])
>
>    Jos 12
>
> |domain error: Jos
>
> | Jos 12
>
>
>
> On Thu, May 9, 2013 at 1:11 AM, Linda Alvord <[email protected]
> >wrote:
>
> > Marc, your reference was helpful.
> >
> >    Jos=:(1 }. ] |.~ [: <: [)^:(1 < [: # ])^:_ [: i. ]
> >    Josephus2 =: 4 :'(|x&+)/i.->:y'
> >
> > The 4 indicates a dyad function only:
> >
> >     Jos 12
> > 10
> >    Josephus2 12
> > |domain error: Josephus2
> > |       Josephus2 12
> >
> >
> > Jos allows a monadic result, but I have no idea of its meaning.
> > Josephus does not allow a monadic use.
> >
> > Thanks.  Linda
> >
> >
> >
> > On Wed, May 8, 2013 at 8:27 AM, Linda Alvord <[email protected]
> > >wrote:
> >
> > > Since both verbs are dyadic, what is the meaning of  4 :  in Josephus2
> ?
> >
> >
> > I'm not sure I understand your question-you defined Josephus2 as a
> > dyadic verb.
> >
> > ':' is the explicit definition conjunction (m : n). Where the left
> > argument 'm' is 4, a dyadic verb is produced; 'n' is the body of the
> > verb. (See
> > http://www.jsoftware.com/help/dictionary/d310n.htm.)
> >
> > Best,
> > Marc
> > ----------------------------------------------------------------------
> > 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
>
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to