2 main advantages,
1. if the conjunction refers to names in its locale, then those names "stay
referenced" when it returns a verb.
a_t_ =: 3
fxgy_t_ =: 2 : 'a + u&v'
+ fxgy_t_ *:
3 + +&*:
bad_t_ =: 2 : 'a + x u&v y'
+ bad_t_ *:
+ (2 : 'a + x u&v y') *:
if the caller of the conjunction is not inside t locale, then a is taken from
caller's locale when this will execute. Error if there is no a defined, or
random duck typed processing that is rarely wanted (though possible)
It also fails because it doesn't return a dyadic verb, so correct version is:
bad_t_ =: 2 : (':';'a + x u&v y')
and will still fail if there is no 'a' defined in caller. Tracking down these
2 errors are likely to be puzzling if you didn't know these issues to begin
with.
2. I call modifiers that don't access x and y, semi-tacit. They return a tacit
verb. Not only does it avoid at least double parsing, but if there was any
rank applied to the conjunction "result" then avoid double parsing for each
cell.
----- Original Message -----
From: R.E. Boss <[email protected]>
To: "[email protected]" <[email protected]>
Sent: Friday, December 4, 2015 11:20 AM
Subject: Re: [Jprogramming] My first J conjuction
> [email protected]] On Behalf Of Henry Rich
> Sent: vrijdag 4 december 2015 11:11
> To: [email protected]
> Subject: Re: [Jprogramming] My first J conjuction
>
> Kip's version doesn't refer to x or y directly. This is an important
> improvement.
Why?
R.E. Boss
> The body of Kip's conjunction is executed BEFORE the x and
> y arguments are seen:
>
> of =: 2 : 'v@[ u v@]'
> + of *:
> *:@[ + *:@]
>
> This is not true of the original form:
>
> fxgfy=: 2 : 0
> :
> (v x) u v y
> )
> + fxgfy *:
> + (2 : (':'; '(v x)u v y')) *:
>
> Henry Rich
>
> On 12/4/2015 1:19 AM, Kip Murray wrote:
> > And you can use a fork in the definition of a conjunction:
> >
> > of =: 2 : 'v@[ u v@]'
> > 4 + of *: 5
> > 41
> >
> > On Thursday, December 3, 2015, Kip Murray <[email protected]>
> wrote:
> >
> >> A fork is not a conjunction but it shows what you are doing:
> >>
> >>
> >> 4 (*:@[ + *:@]) 5
> >> 41
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm