Well, you could do:

PosDiff=: {{la=.x>.y goto_a.label_a. sm=.x<.y goto_b.label_b. la-sm}}

But why would you do that?

--
Raul



On Fri, Sep 24, 2021 at 6:03 AM R.E. Boss <[email protected]> wrote:
> This is (also) the only one I could think of, but apparently there is no 
> other separator available in DD.
> Thanks.
>
> R.E. Boss
>
>
> -----Original Message-----
> From: Programming <[email protected]> On Behalf Of 
> Raul Miller
> Sent: vrijdag 24 september 2021 11:41
> To: Programming forum <[email protected]>
> Subject: Re: [Jprogramming] single line direct definition
>
> Are you looking for this?
>
> PosDiff=: {{la-sm[sm=.x<.y[la=.x>.y}}
>
> --
> Raul
>
> On Fri, Sep 24, 2021 at 5:01 AM R.E. Boss <[email protected]> wrote:
> > Again, I know all that, since quite long actually.
> > But now with the direct definition, {{ }} , how is it done there?
> >
> > R.E. Boss
> >
> > -----Original Message-----
> > From: Programming <[email protected]> On Behalf
> > Of Elijah Stone
> > Sent: vrijdag 24 september 2021 10:34
> > To: [email protected]
> > Subject: Re: [Jprogramming] single line direct definition
> >
> > On Fri, 24 Sep 2021, R.E. Boss wrote:
> >
> > > See https://www.jsoftware.com/help/learning/12.htm
> > >
> > > My point is for a non-trivial verb, how can I cram this in one DD line.
> >
> > One way is to perform the definitions in-line:
> >
> > 4 : 'la - sm [ la =. x >. y [ sm =. x <. y'
> >
> > There is also Michal Wallace's proposal to use '..' as a sentence 
> > separator, with which you might write:
> >
> > 4 : 'la =. x >. y .. sm =. x <. y .. la - sm'
> >
> >   -E
> >
> > > R.E. Boss
> > >
> > >
> > > -----Original Message-----
> > > From: Programming <[email protected]> On
> > > Behalf Of Elijah Stone
> > > Sent: vrijdag 24 september 2021 10:12
> > > To: [email protected]
> > > Subject: Re: [Jprogramming] single line direct definition
> > >
> > > That is the same as:
> > >
> > > 4 : 0
> > > la =. x >. y
> > > sm =. x <. y
> > > la - sm
> > > )
> > >
> > > We can substitute the intermediate variables:
> > >
> > > 4 : 0
> > > (x >. y) - (x <. y)
> > > )
> > >
> > > And collapse onto one line: 4 : '(x >. y) - (x <. y)'
> > >
> > > Worth noting is that we can write this as a fork: >. - <.
> > >
> > >  -E
> > >
> > > On Fri, 24 Sep 2021, R.E. Boss wrote:
> > >
> > >> From Learning J
> > >>
> > >> PosDiff =: 4 : ('la =. x >. y' ; 'sm =. x <. y' ;  'la - sm')
> > >>
> > >> How do I transfer this in a single line direct definition?
> > >>
> > >>
> > >> R.E. Boss
> > >> -------------------------------------------------------------------
> > >> --
> > >> - 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
> ----------------------------------------------------------------------
> 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