It is "obvious".
Fast u/\. does not require special properties for
u . Fast u/\ requires that u be associative or
quasi-associative. The interpreter has a very
limited mechanism for knowing which verbs are
associative.
----- Original Message -----
From: Oleg Kobchenko <[EMAIL PROTECTED]>
Date: Wednesday, December 13, 2006 1:32 pm
Subject: RE: [Jprogramming] What a drag
> OK. So +/\ is special code then.
> Thanks, Raul and Jose.
>
> Q=: _2+?1000$5
> (+/\ -: ([+])/\) Q
> 1
> (+/\ -: ([+])~/\.&.|.) Q
> 1
> ts '+/\ Q'
> 1.02999e_5 5248
> ts '+/\.&.|. Q'
> 1.50313e_5 9728
> ts '([+])/\ Q'
> 0.311365 18304
> ts '([+])~/\.&.|. Q'
> 0.000485823 10496
>
>
> Still, it's kind of murky.
> Is there a link where it is systematically treated?
>
> Also here is a relationship,
>
> -/\1 2 3 4 5
> 1 _1 2 _2 3
> -/@|.\.&.|.1 2 3 4 5
> 1 _1 2 _2 3
>
> -/\.&.|.1 2 3 4 5
> 1 1 2 2 3
> -/@|.\1 2 3 4 5
> 1 1 2 2 3
>
>
>
> --- Jose Mario Quintana <[EMAIL PROTECTED]> wrote:
>
> > > [EMAIL PROTECTED] On Behalf Of Oleg Kobchenko
> > > Subject: RE: [Jprogramming] What a drag
> > >
> > > Wow. How is this exmpalined?
> >
> > Using a symbolic verb (and nouns)...
> >
> > lr'u'
> > '('"_ , [ , ' u '"_ , ] , ')'"_
> >
> > (Y1;Y2;'..';YN)
> > +--+--+--+--+
> > |Y1|Y2|..|YN|
> > +--+--+--+--+
> >
> > u e/\ (Y1;Y2;'..';YN)
> > +--+---------+----------------+-----------------------+
> > |Y1|(Y1 u Y2)|(Y1 u (Y2 u ..))|(Y1 u (Y2 u (.. u YN)))|
> > +--+---------+----------------+-----------------------+
> >
> > (u~ e/\. &. |.) (Y1;Y2;'..';YN)
> > +--+---------+----------------+-----------------------+
> > |Y1|(Y1 u Y2)|((Y1 u Y2) u ..)|(((Y1 u Y2) u ..) u YN)|
> > +--+---------+----------------+-----------------------+
> >
> > \. builds on previous results.
> >
> >
> > >
> > > Whereas
> > >
> > > Q=: _2+?1e6$5
> > > (+/\ -: +/\.&.|.) Q
> > > 1
> > > ts '+/\ Q'
> > > 0.00822809 4.19546e6
> > > ts '+/\.&.|. Q'
> > > 0.0244686 8.39014e6
> >
> >
> > J "knows" that + is associative so there is no advantage, on the
> contrary.>
> >
> > >
> > >
> > > --- Jose Mario Quintana <[EMAIL PROTECTED]>
> wrote:> >
> > > >
> > > > T=. ?1000$9
> > > > st'(([^:(0=]))/\) T'
> > > > 19136 2.13611842
> > > > st'(([^:(0=]))~/\. &. |.) T'
> > > > 11200 0.00382534652
> > > >
> > > > ((([^:(0=]))/\) -: (([^:(0=]))~/\. &. |.)) T
> > > > 1
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm