Technical Correspondence
Vector 19:1, page 106
Transcribed from the printed issue; not yet reviewed. Read it in the PDF of the issue, page 106
Rank and Extending the Domains¶
With reference to his letter in Vector 18.4, I thank Norman Thomson for his interest, but I wonder what his understanding of Occam’s Razor is. If he sees it as no more than a word-count function, then the winner surely is Trenchard More, 25 or more years ago, whose definition, after a statement of the problem, also takes 16 words:
Given an arbitrary monadic operation ?, how does one produce another operation that applies ? to the items of an array rather than the array itself? … Let ? be transformed to the monadic operation : ? by an operator called the replacement operator.
The trouble with this definition, as with Norman’s, is that it leaves the process undefined. There are infinitely many processes satisfying the stated requirements, and we need something more specific. The process described in my paper accommodates arrays of instances of parameterised classes and is, I think, the smallest process to do so adequately.
In the previous issue of Vector 18.4, Norman Thomson expounded on the virtues of understanding noun and verb rank in J. To his illustrations (responding to Phil Chastney’s APL examples on "Extending the Domain" in Vector 18.3), please add the following punch lines.
[ t =: >:i.3 4 NB. Same t is Increment of axis Integers
in a 3 by 4 table
1 2 3 4
5 6 7 8
9 10 11 12
Shift each row of the table:
1 0 2 |."0 1 t NB. Each Rank 0 atom on left Rotate
each corresponding Rank 1 list on right
2 3 4 1
5 6 7 8
11 12 9 10
[ u =: 2 3 $ 'abcdef'
NB. Same u is 2 by 3 Shape characters
into a table
abc
def
Basic ways to join a table with a (short) list:
u , 'XY' NB. u Append list 'XY'
with blank fill element
abc
def
XY
u ,"1 'XY' NB. u Append each Rank 1 list
to list 'XY'
abcXY
defXY
u ,"1 0 'XY' NB. u Append each Rank 1 list
to each Rank 0 atom of 'XY'
abcX
defY
(Or, using Stitch, simply: u ,. 'XY')