A Fractal Verb in J
Vector 12:2, page 131
Transcribed from the printed issue; not yet reviewed. Read it in the PDF of the issue, page 131
At Christmas I sent a copy of J to a professor at Cornell College in Iowa where I went to school. I also sent this verb. It prints one line at a time like Norman Thomson’s program in Vector Vol.11 No.3 page 17.
Primitives like + and programs like F are verbs. F makes a square fractal.
F 16
┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼
┼ ┼ ┼ ┼ ┼ ┼ ┼ ┼
┼┼ ┼┼ ┼┼ ┼┼
┼ ┼ ┼ ┼
┼┼┼┼ ┼┼┼┼
┼ ┼ ┼ ┼
┼┼ ┼┼
┼ ┼
┼┼┼┼┼┼┼┼
┼ ┼ ┼ ┼
┼┼ ┼┼
┼ ┼
┼┼┼┼
┼ ┼
┼┼
┼
Consider the sentence "She walks fast.". The adverb "fast" changes the meaning of "walk". English doesn’t need a "walkfast" verb. Consider the composition (+/). The Insert adverb (/) sticks the Plus verb (+) between each item of the argument. J doesn’t need a SUM built-in function.
J programs can be composed of nothing but verbs. You don’t have to refer to application data. Iverson calls this "tacit definition". F is a tacit program. The execution sequence is mapped by Track. In a track map each composed subverb is pegged with a horizontal line.
F=. Kill@Draw@({.&1)
Kill=. (1.0 0)"_
Draw=. Next@NEIP^:#
Next=. [ Screen
Screen=. {&' ┼' (1!:2) 2:
NEIP=. ~:/\


The right argument of many conjunctions is executed before the left. In Fractal, ([ ——) is Next and (—— —— 2:) is Screen. Two isolated verbs are a "hook" and three are a "fork". A fork applies the first and last verbs to its argument, and then applies the middle verb to their results. A hook applies the last verb to its argument, and then applies the first verb to its argument and to the result of the last verb.
Vocabulary¶
| Verbs | Adverbs | ||
|---|---|---|---|
+ |
Plus | / |
Insert |
{. |
Take | \ |
Prefix |
i. |
Index of | f. |
Fix |
# |
Tally | Conjunctions | |
[ |
Left | @ |
Atop |
{ |
From | & |
Bond |
~: |
Not Equal | " |
Rank |
2: |
Two | " |
Constant |
- |
Minus | ^: |
Power |
< |
Box | !: |
Foreign |
F |
Map fractal | Nouns | |
Kill |
Display nothing | 1 |
One |
Draw |
Main | 0 0 |
Zero zero |
Next |
Skip '┼' and blank | _ |
Infinity |
Screen |
Display as '┼' and blank | 2 |
Two |
NEIP |
Not Equal Insert Prefix | ||
Fractal |
Map fractal | ||
Track |
Simplify boxed representation |
Two English words like A and Ad usually have nothing in common. Two J words like { and {. frequently do. From selects any. Take selects from the top or bottom. Rank is (verb"noun). Constant is (noun"noun). Foreign links the operating system. Write is 1!:2. Boxed representation is 5!:2. Underbar (_) is infinity only when isolated.