Perhaps the requirement for scalars to be something special is that common arithmetic and most of today's computers are strictly scalar. When one has to deal with arrays it is necessary to do special things. In the case of computers, build for loops or whatever. In mathematics we create special symbols like a plus with a circle around it to handle some array calculation and use bold caps to represent arrays. So we say arrays are special, not at all like a scalar.
Then came along APL and now J. In them the common scalar arithmetic calculations are extended to arrays in a natural way. So now in J a scalar is not really special. It is perfectly alright to treat it as an array with only one element. On Tue, Oct 26, 2010 at 2:22 PM, <[email protected]> wrote: > > I teach the kids that 'scalar' and 'atom' mean a rank-0 thing, and > > 'array' means rank > 0. Yeah, I know it's not standard. > > I was certainly taught that "APL scalars are rank-0 arrays" and > "all APL values are arrays" right at the beginning, and in particular > I can remember that > > rho 5 > > rho rho 5 > 0 > > was used to drive that point home. (Well, it might have been a > value different from 5.) > > I was taught in Physics at school that scalars could be viewed as > zero-dimensional things. I cannot time my introduction into the > concept of "hyper-planes" and the dimensional aspect of a "point" > in the context of vector algebra (I believe it was still in school, > too.) APL certainly wasn't the first context in my life which > treated scalars as zero-dimensional things. It was just the first > programming language I came across which treated them as such. > Finally! > > Martin > ---------------------------------------------------------------------- > For information about J forums see http://www.jsoftware.com/forums.htm > ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
