[Jprogramming] Truncating
ramacd
ramacd at nbnet.nb.ca
Tue Mar 6 22:16:23 HKT 2007
Folks;
The benefit I saw was that of the verb being separable from the noun.
If I have:
i.&.(p:^:_1) x
or, in a more general case:
f g h x NB. f,g,h verbs; x noun
which is different from
(f g h) x
just like
(p: i. p^:_1) x
is different. However, adding the ()'s in
(i.&.(p:^:_1) x
preserves meaning.
To have a separable expression, you have to do something like:
(f at g@h) x NB. eeew!
To me, the point isn't the "pattern" evoked by the &. conjunction, it's the
whole concept of verb expressions and the expansion of possibilities, which
APL only skimmed with f/ and f.g
The thing that does tug at me, it is getting my head around how a dyadic
verb has an inverse. I think the same thing happens with #^:_1but I haven't
yet seen nor thought up a good explanation for how those inverse cases were
derived.
------------------------------------------------------------------------
|\/| Randy A MacDonald | APL: If you can say it, it's done.. (ram)
|/\| ramacd at nbnet.nb.ca |
|\ | | 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.84.219/
-----------------------------------------------------(INTP)----{ gnat }-
----- Original Message -----
From: "Roger Hui" <rhui000 at shaw.ca>
To: "Programming forum" <programming at jsoftware.com>
Sent: Monday, March 05, 2007 11:51 AM
Subject: Re: [Jprogramming] Truncating
> The point is not the number of characters but a
> pattern that is useful in other areas. In this case
> the pattern is duality. For other examples of
> duality, please see:
> http://www.jsoftware.com/jwiki/Essays/Under
>
>
>
> ----- Original Message -----
> From: Geoff Canyon <geoffc at inspiredlogic.com>
> Date: Sunday, March 4, 2007 10:04 pm
> Subject: Re: [Jprogramming] Truncating
>
> > Wow -- that's great stuff. I tried it, and it worked a treat. If I
> >
> > understand correctly, the &. command joins the i. and the
> > (p:^:_1),
> > which is the inverse of p:. So this command says: apply the
> > inverse
> > of the prime function to 10000 to find what the order of that
> > prime
> > is, then iterate up to that number, then get the primes up to that
> >
> > index. I'm curious -- how is the use of &. better than just
> > writing
> > out what is needed. As far as I can see these are equivalent:
> >
> > i.&.(p:^:_1)10000
> > p:i.(p:^:_1)10000
> >
> > They take the same number of characters to type, so why is the
> > former
> > preferred to the latter?
> >
> > regards,
> >
> > Geoff
> >
> > On Mar 4, 2007, at 12:42 AM, Raul Miller wrote:
> >
> > > On 3/4/07, Geoff Canyon <geoffc at inspiredlogic.com> wrote:
> > >> based on a calculation? For example, suppose I want to generate all
> > >> the primes < 10,000.
> > >
> > > i.&.(p:^:_1)10000
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
>
More information about the Programming
mailing list