Index   <<   >>

Forever the same

The 10 verbs 0: 1: 2: 3: 4: 5: 6: 7: 8: and 9: each have a monad and a dyad form, and each always returns the value of its numeric component.

Among all constants, 0 is the most frequently occurring, and 1 is next in frequency. J provides all 10 verbs listed above in order that small integer values be easily accessible when programming.

One frequent use of them is to turn compositions into forks. For example, the “take 1” phrase used in making diagonal matrices can be written {.&1 (take with one), and then applied to its argument: ({.&1) 5 will yield 1 0 0 0 0 . With the availability of the verb 1: , this can be written in the form

   (] {. 1:) 5