m=: '3 %: y.' d=: 'x.%: y.' x.=: 4 y.=: 27 4096 ". m 3 16 do=: ". do d 2.27951 8The word formation rules of J are prescribed in Part I of the dictionary. Moreover, the word-formation function ;: can be applied to the string representing a sentence to produce a boxed list of its words:
;: m +-+--+--+ |3|%:|y.| +-+--+--+ words=: ;: words d +--+--+--+ |x.|%:|y.| +--+--+--+The rhematic rules of J apply reasonably well to English phrases:
words p=: 'Nobly, nobly, Cape St. Vincent' +-----+-+-----+-+----+---+-------+ |Nobly|,|nobly|,|Cape|St.|Vincent| +-----+-+-----+-+----+---+-------+ >words p Nobly , nobly , Cape St. Vincent
Exercises
16.1 | Choose sentences such as pp=:+//.@(*/)
from earlier exercises, enclose them in quotes,
and observe the effects of word-formation (;:)
on them. |
16.2 | The following facility is available under Windows and Macintosh:
Move the cursor to the left of a line so that it is separated
from the line by one or more spaces, and press Ctrl F1 to display
the individually boxed words in the sentence. |