greg (07/06/82)
One of the nice (amazing?) aspects of apl is the generality of functions with respect to the shape of their arguments. I can say 'a := a + 4' or 'sum := +/ a' with almost no concern for whether 'a' is an array with 7 dimensions or a simple vector. 'Boundary' errors are often avoided in apl because statements usually make sense even if an argument is degenerate. I claim, however, that apl would do well to extend the above principle far beyond its current level. Arrays, operators, and functions are all just different manifestations of the same basic idea, and yet there are profound syntactic and semantic inconsistencies among their respective treatments in apl. If I understood him correctly, this was one of the points that Alan Perlis made in his talk at APL '81. If a function is thought of as a set of ordered pairs with the property that no two elements are the same in the first slot, then an array is simply a set defined via exhaustive enumeration, and a function (in the apl sense) is just a set defined by providing a rule. Array indexing, function evaluation, and application of operators would all have the same syntax in this approach. This would of course make apl look completely different, and it is probably best to think of this approach as being the basis for defining a new language, Son of Apl (and Lisp). - Greg Johnson U Wis - Madison