<<   >>

4. Bar Chart

'.⎕'[x∘.>⍳⌈/x]

A bar chart of non-negative integer vector x .

   x← 3 1 4 1 5 9 
   '.⎕'[x∘.>⍳⌈/x]
⎕⎕⎕......
⎕........
⎕⎕⎕⎕.....
⎕........
⎕⎕⎕⎕⎕....
⎕⎕⎕⎕⎕⎕⎕⎕⎕

I encountered this phrase when I first learned APL in the mid 1970s. By then, it was part of the APL milieu, found in STATPACK [19] and APL in Exposition [20]. (I believe I saw it in the former.) The phrase brought home to me that indices can be entire arrays.

Anecdote

One of the best known epiphanies in Western culture is possibly that of Saul on the way to Damascus. My own epiphany in programming languages was much less dramatic than Saul’s. I was not going anywhere, there was no blinding light or voice from above, nor did I fall down. It was in 1965 or 1966, and I was sitting quietly in my office in the Department of Computing Science at the University of Alberta thinking about the commonly occurring statistical problem of classifying a number of observations given the left-hand end of the first frequency class, the class width, and the number of classes. This is a problem I had already handled in other languages but now I was trying to program it in a new language called Iverson’s notation or APL.

— Keith Smillie, Kenneth Iverson, APL and J:
Some Personal Recollections
, November 2004 [21].