There is one important use of Reflexive (i.~) unnamed
on that page (although used in other examples).
Applied with Key (/.) it is also unmentioned on
http://www.jsoftware.com/jwiki/Essays/Key
i.~ Self-Index is the simplest equivalent for
the x argument "key" of dyadic (/.);
Self-Classify is invariant under self-index
A=. ?.10000 5$3 NB. complex key
#~.A
243
I=. i.~A NB. simplest equivalent
I -:&= A NB. same self-classify
1
B=: ?.10000$0 NB. grouped values
ts'A (+//.,(+/%#)/.,<.//.,>.//.,:#/.) B'
0.00653044 266624
ts'I (+//.,(+/%#)/.,<.//.,>.//.,:#/.) B'
0.000493079 53504
0.00653044 266624%0.000493079 53504
13.2442 4.98325 NB. 13x time and 5x space
10 ts'(i.~A) (+//.,(+/%#)/.,<.//.,>.//.,:#/.) B'
0.00174575 201216
0.00646434 266624 % 0.00174575 201216
3.7029 1.32506
See more at Aggregation model in JDB
http://www.jsoftware.com/jwiki/JDB/Aggregation/Formal
----- Original Message ----
> From: Roger Hui <[EMAIL PROTECTED]>
> To: Programming forum <[email protected]>
> Sent: Friday, September 19, 2008 1:30:31 AM
> Subject: Re: [Jprogramming] Verb Sequence or Ranking problem?
>
> See http://www.jsoftware.com/jwiki/Essays/Reflexive
> for useful examples of x f x .
>
> See http://www.jsoftware.com/help/dictionary/special.htm
> under /. (about mid-way down the page) for other uses
> of f/.
>
>
>
> ----- Original Message -----
> From: Alex Rufon
> Date: Thursday, September 18, 2008 22:08
> Subject: RE: [Jprogramming] Verb Sequence or Ranking problem?
> To: Programming forum
>
> > Oh.
> >
> > I know about the reflexive primitive. But I always thought that you
> > always need both left and right parameters to switch. This
> > confused me
> > because what I understood was that the code was to be run as:
> > a #/.
> > |syntax error
> > | a#/.
> >
> > So basically, this is a shortcut/trick where the noun is used as both
> > left and right parameters. Hmmmm.
> >
> > Thanks Rick. I appreciate it.
> >
> > r/Alex
> >
> > -----Original Message-----
> > From: [EMAIL PROTECTED]
> > [mailto:[EMAIL PROTECTED] On Behalf Of
> > Sherlock, Ric
> > Sent: Friday, September 19, 2008 12:45 PM
> > To: Programming forum
> > Subject: RE: [Jprogramming] Verb Sequence or Ranking problem?
> >
> > ---Alex Rufon wrote:
> > > Can anybody elaborate on #/.~a
> > >
> > > I don't understand the presence of ~ in that sequence. Is this
> > another> example of a fork/hook?
> >
> > This is not a tacit expression so it isn't a fork or hook.
> > See the dictionary page for Reflexive:
> > http://www.jsoftware.com/help/dictionary/d220v.htm
> >
> > #/.~ a
> > 2 2 1 3
> > a #/. a
> > 2 2 1 3
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm