In APL, before or after the introduction of squish-quad indexing, a scalar is an array.
----- Original Message ----- From: Ian Shannon <[email protected]> Date: Monday, October 25, 2010 20:00 Subject: Re: [Jgeneral] "J In A Day" --crits please To: General forum <[email protected]> > Roger, > > To supplement/replace bracket [; ; ] index notation in APL, IBM > introduced the index function (squid I think it is called) in > APL2 which can index a scalar as well as arrays that bracket > indexing can. Bracket index cannot index a scalar, > > Hence stating that "parts of an array may be selected by bracket > indexing" either needs a note that this does not include arrays > of rank zero, or in VSAPL scalars are not considered arrays. > > I submit that, with the introduction of squid, scalars were made > first class citizens in IBMs APL and confirmed a place as an > array capable of being indexed like other arrays. Up until then > scalars were (one could argue) not arrays. > > BTW. In describing APL and J to others one of the first > "novel" features of the languages I talk about is that data > items in the languages are "array of any rank" and the plain > numbers that they would expect to be data items in a computer > language are just "arrays of rank 0". > > Ian > > > Ian Shannon > Landscape Modelling and Decision Support Section > Department of Environment, Climate Change & Water (NSW) > PO Box A290 Sydney South > NSW 1232 > Phone: (02) 99 955 490 > Mob: 0428 296 729 > email: [email protected] > web: http://www.environment.nsw.gov.au > > Please consider the environment before printing my email > > > > -----Original Message----- > From: [email protected] [mailto:general- > [email protected]] On Behalf Of Roger Hui > Sent: Tuesday, 26 October 2010 12:19 PM > To: General forum > Subject: Re: [Jgeneral] "J In A Day" --crits please > > I had/have been an APLer for many years and I have > never heard of scalars not being arrays. As far as > I know 99 is not just now deemed an array but > have always been deemed an array. I'd be interested > in any APL reference you can find that says otherwise. > > A more ancient reference for that fact that a scalar is an > array. > Falkoff and Iverson, The APL\360 Terminal System, 1967-10-16. > http://www.jsoftware.com/papers/APL360TerminalSystem.htm > > - A vector has a "rank" of one, the term being used, > as in tensor analysis, to mean the number of indices > required to identify a single element in an array. > Hence, a scalar has rank zero and a matrix has rank two. > > - No special notational convention is required for the > element-by-element extension, so that in the expression a+b , > for example, a and b may be any pair of matching arrays. > If one argument is a scalar the other may be any array, ... > > --- > > In any case, you have not addressed the practical point > I raised: if a scalar is not an array, you are going to > need a term for "array or scalar". Another way to > look at it is, why is it useful to distinguish between > an array and a scalar? > > Whether a scalar is an array is not a statement that > you can prove one way or the other, and you have to > decide on considerations in the preceding paragraph, > or considerations similar to same. > > Finally, why is it counter-intuitive that a scalar is > an array? > > > > ----------------------------------------------------------------- > ----------------------------------------------------------------- > ------------------------------------ > This email is intended for the addressee(s) named and may > contain confidential and/or privileged information. > If you are not the intended recipient, please notify the sender > and then delete it immediately. > Any views expressed in this email are those of the individual > sender except where the sender expressly and with authority > states them to be the views of the Department of Environment, > Climate Change & Water NSW. > > PLEASE CONSIDER THE ENVIRONMENT BEFORE PRINTING THIS EMAIL ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
