Newsgroups: comp.lang.apl
Path: watmath!watserv2.uwaterloo.ca!watserv1!seary@sfu.ca
From: seary@sfu.ca
Subject: '[;] Considered. Harmful?
Message-ID: <9304122017.AA09190@monashee.sfu.ca>
Originator: daemon@watserv1.uwaterloo.ca
Sender: news@watserv1.uwaterloo.ca
Organization: University of Waterloo
Date: Mon, 12 Apr 1993 20:17:11 GMT
X-Mailer: ELM [version 2.3 PL11]

Would it be harmful to consider (again) the role played by ', [, ;, and ]?
No.
Let's start with '.
It's punctuation. So you can write 'ABC'[2]. In APL2 1 2 3[2] is illegal,
but (1 2 3)[2] is not because ( and ) are punctuation.
It's something else. Inside '...' is a special little language which is 
NOT APL. It doesn't do very much, just replacing '' with '. Still,
it's a precedent: ' is punctuation which allows non-APL processing
within its confines. 
Now consider [ and ]. Like ', they are punctuation within which
non-APL processng can occur. [ returns addresses and ] returns
contents of the adresses.
Adresses are not legal APL objects, so every [ must have a matching ].
Now [ acts very much like it does in C, but ] is more like a de-referencing
OPERATOR which can apply the function on its right to the contents of the
addresses on its left. If that function happens to be <-, then we get
IN-PLACE assignment. This is so useful that most people don't want to
give it up. 
; provides all the pointer arithmetic within [ and ]. It was cleverly chosen
(on purpose, no doubt) as a short-hand for jot., where the jot is written
over the comma (where have we seen this notational device before?). Thus:
(1 2 jot., 3 4) [] A <-> A[1 2;3 4]   (where [] is APL2 squad, dyadic index)
We still have to deal with A[1;] where the non-symbol to the right of ;
represents EVERYTHING (all the items in this dimension).
"You can't have everything. Where would you put it?"
We accept this piece of wisdom. It would take too long to write
everything down,so we don't write anything. Anyway, it's not *really*
APL, it's pointer arithmetic, and as long as every-one understands the rules...

IV) A Thing I would like to see in APL2 is scatter indexing like
       Dyalog and APL*PLUS allow:
  A[(1 2)(3 4)]<-47 78          NB. Dyalog and APL*PLUS
  A[1;2]<-47 <> A[3;4]<-78      NB. APL2/PC "scatter indexing"
  (((1 2)(3 4))[]"cA)<-47 78    NB. APL2 scatter indexing on mainframes (?)
The last is even more complicated than J's amend, and it is not clear that
this will happen IN-PLACE.

Another option is to throw the whole thing out because we can't stand the
anomaly. There! Now where's the damn baby? But we are still left with that
niggling little anomaly of what happens inside '..'. Even in J.
                           Andrew Seary

