Hi Henry;

You are correct in that the rank of +/ is infinite, but I think Terrence was
referring to +, which _does_ have rank 0.

>: ...
------------------------------------------------------------------------
|\/| Randy A MacDonald   | APL: If you can say it, it's done.. (ram)
|/\| [EMAIL PROTECTED]  |
|\ |                     | The only real problem with APL is that
BSc(Math) UNBF'83        | it is "still ahead of its time."
Sapere Aude              |     - Morten Kromberg
Natural Born APL'er      | Demo website: http://156.34.72.144/
-----------------------------------------------------(INTP)----{ gnat }-

----- Original Message ----- 
From: "Henry Rich" <[EMAIL PROTECTED]>
To: "'General forum'" <[email protected]>
Sent: Wednesday, April 04, 2007 11:46 AM
Subject: RE: [Jgeneral] "J for C Programmers" - Controlling Verb
ExecutionBySpecifying a Rank - please flesh out discussion - myattempt is
supplied


> I think your analysis is correct, except where you say
> 'the verb rank is 0' - actually, it is infinite.
>
> Henry Rich
>
> > -----Original Message-----
> > From: [EMAIL PROTECTED]
> > [mailto:[EMAIL PROTECTED] On Behalf Of Terrence Brannon
> > Sent: Wednesday, April 04, 2007 8:49 AM
> > To: General forum
> > Subject: [Jgeneral] "J for C Programmers" - Controlling Verb
> > Execution BySpecifying a Rank - please flesh out discussion -
> > my attempt is supplied
> >
> > < quote href =
> > http://www.jsoftware.com/help/jforc/loopless_code_i_verbs_have
> > _r.htm#_Toc141157987
> > >
> > consider the new verb monad +/, which creates the total of the items
> > of its operand (just think of it as 'monad SumItems'):
> >
> >    +/ 1 2 3
> >
> > 6
> >
> > The result was 1 + 2 + 3, as expected.
> >
> > </ quote>
> >
> > To be honest, it would be nice if this result were fleshed out because
> > all the prior examples in this section were based on operands of
> > rank-2. This rank-1 example can be tricky to a beginner because the
> > items of a 1-cell are not arrays, but atoms. Here is my fleshing out
> > of this example:
> >
> > +/ i. 3
> >
> > The verb rank is 0 and the noun rank is 1, therefore, r is 1 and so we
> > will be applying the verb to 1-cells. The frame f is empty.
> >
> > Think of the operand as an empty array of 1-cells [??? sounds weird]
> > So the operand is a single 1-cell: 0 1 2
> > It is not an array of anything in this case.
> >
> > The verb is applied to each cell, and we only have a single 1-cell:
> > +/ 0 1 2
> >
> > Since +/ creates a total of the _items_ of it operand, we must find
> > the _items_ of our operand. The items of a 1-cell are 0-cells. So the
> > members of the 1-cell are our _items_.
> > And +/ will create the total of them, yielding 3
> >
> >
> >
> > I am thankful for for Figure 1 on this page:
> > http://www.jsoftware.com/help/jforc/loopless_code_i_verbs_have
> > _r.htm#_Toc141157986
> > because I simply imitated the step-by-step thought process there to
> > come up with the fleshing out that I attempted above.
> > ----------------------------------------------------------------------
> > 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