>>
<<
Usr
Pri
JfC
LJ
Phr
Dic
Rel
Voc
!:
Help
Primer
Word formation
The monad ;: can be useful in figuring out what the words are in a sentence. The word formation primitive takes a string as its right argument, splits it into words, and returns a result with each word in a box. For now, don't worry about what the boxes are, just note how visually helpful they are. You'll learn about boxes in later sections.
;: '2 + 3'
+-----+
¦2¦+¦3¦
+-----+
;: '2.5 + 3e4'
+---+-+---+
¦2.5¦+¦3e4¦
+---+-+---+
;: 'a =. 1 2 3'
+-+--+-----+
¦a¦=.¦1 2 3¦
+-+--+-----+
;: 'test + 123 NB. this is a comment'
+----+-+---+---------------------+
¦test¦+¦123¦NB. this is a comment¦
+----+-+---+---------------------+
;: 'def =. ''testing 1 2 3'''
+---+--+---------------+
¦def¦=.¦'testing 1 2 3'¦
+---+--+---------------+
Note that the following are all J words and each goes in its own box:
2.5
3e4
=.
1 2 3
test
NB. this is a comment
'testing 1 2 3'
It might surprise you that constants such as 1 2 3 and 'testing 1 2 3' are J words. This is an important point and understanding it is necessary in reading and writing J sentences.
If you are ever puzzled by a J sentence (it could happen), one of the things you can do is apply ;: to it to be sure you know the words. You can then worry about the meanings of those words.
Look up ;: in the J Dictionary. The informal name for ;: is word formation.
>>
<<
Usr
Pri
JfC
LJ
Phr
Dic
Rel
Voc
!:
Help
Primer