> Incidentally, {.&> doesn't save anymore brackets than {."0
Counterexample:
x{.&>1!:1<'file'
x{."(0)1!:1<'file'
x{."0]1!:1<'file'
----- Original Message -----
From: "Sherlock, Ric" <[email protected]>
Date: Wednesday, May 13, 2009 20:01
Subject: Re: [Jprogramming] Newbie question about {.&>
To: Programming forum <[email protected]>
> I think Devon's analysis is probably correct (given that I was
> the coder :-)). I came to J from an APL background where there
> was no Rank. The primitive <each> was used quite a lot
> instead. J defines the idiom &.> as "each" and &> as "every" and
> I naturally gravitated to them rather than Rank initially. I
> imagine I still have that bias to some extent.
>
> Incidentally, {.&> doesn't save anymore brackets than {."0
>
> > From: Devon McCormick
> >
> > You are correct - the effect is the same as '{."0' which you
> can see if
> > you substitute this: the expression returns the same
> result. It's
> > probably a matter of how the expression was arrived at or how
> the coder
> > is used to working, though I would maintain that the rank-zero
> take is
> > a clearer expression of what is intended.
> >
> > On Wed, May 13, 2009 at 10:10 PM, gary ng
> <[email protected]> wrote:
> >
> > > On Wed, May 13, 2009 at 6:53 PM, bill lam <[email protected]>
> > wrote:
> > >
> > > > On Wed, 13 May 2009, gary ng wrote:
> > > > > Are there any hidden 'gem' or reason to say '{.&>'
> rather than
> > > > > '({."0)' as to me the only reason for the &> is to
> modify the
> > > > > rank of {. ?
> > > >
> > > > If the argument is un-boxed, why would you use {.&>
> ? What effect
> > > > did you expect from that > ?
> > > >
> > >
> > > That is what puzzled me. This is the original code I came
> across :
> > >
> > > (,|....@}:)(,.|....@}:"1)({.&>~#{.i:@#)(65}.a.)(>:@i.{.[)'E'
> > >
> > > from http://www.craigmurphy.com/blog/?p=1417#comment-66863
> > >
> > > It does save a pair of '()' but that seems to be not a good
> practice> > as it doesn't use the 'primary' functionality of '>'
> which is
> > > to unbox
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm