Newsgroups: comp.lang.apl
Path: watmath!watserv2.uwaterloo.ca!torn!cs.utexas.edu!uunet!usc!rpi!utcsri!torsqnt!geac!itcyyz!yrloc!hui
From: hui@yrloc.ipsa.reuter.COM (Roger Hui)
Subject: Re: Changes in J?
Message-ID: <1992Aug10.045023.25992@yrloc.ipsa.reuter.COM>
Organization: Iverson Software Inc.
References: <14869@umd5.umd.edu> <BsMKG9.64D@math.uwaterloo.ca>
Date: Mon, 10 Aug 92 04:50:23 GMT
Lines: 51

Patrick Harrington writes:
 
> ... under 4.1 I could reflect an array of points about the x-axis:
>
>    xref=. 'y.*1 _1':''
>    a=. 5 2$ 1 10 2 20 3 30 4 40 5 50
>    xref a
> 1 _10
> 2 _20
>    ...
>
> But 5.1 doesn't like that:
>
>    xref a
> length error
> [0] y.*1 _1
>
> I didn't see anything in the status.doc file that would explain this change.
 
This is due to a change in "agreement", and is noted in status.doc
under " (rank), as "prefix agreement", superseding "suffix agreement":
 
Suffix agreement:  for a dyad the left and right frames must match,
or one must be a _suffix_ of the other.
 
Prefix agreement:  for a dyad the left and right frames must match,
or one must be a _prefix_ of the other.  For example:
 
   a               b             a+b                 b+10 20 30 40
100 200 300     0 1  2  3     100 101 102 103     length error
                4 5  6  7     204 205 206 207
                8 9 10 11     308 309 310 311
 
Prefix agreement was prompted by discussions with Arthur Whitney when
he visited us in May.  It is more consistent with the leading axis
orientation of the rest of the language.  In the special case where the
prefix is of length one (as above), prefix agreement can be described simply
as "itemwise application", a concept expected to be readily understandable
by the laity.  Moreover, under prefix agreement, the definition of inner
product is simplified; e.g.  +/ .*  <->  +/@(*"1 _) .  The old suffix
agreement behaviour obtains by an application of rank.  (In "xref" above,
the old behaviour obtains by y.*"(1) 1 _1, as Lee Dickey pointed out.)
 
> I also find that I need to enclose some things in ( .. ) which 4.1
> didn't object to.
 
I can't think of what this might be.  Please be more specific.

------------------------------------
Roger Hui, Iverson Software Inc., 33 Major Street, Toronto, Ontario  M5S 2K9
Phone: (416) 925 6096;  Fax: (416) 488 7559
