H. Frets and Scripts

>> << Ndx Usr Pri Phr Dic Rel Voc !: wd Help Dictionary

H. Frets and Scripts
Host systems commonly use the “line-feed” or “carriage return” characters`10{a.` or`13{a.` (or both together) as frets to mark divisions into individual lines. A character list provided with zero or more frets will be called a script.
As detailed in Appendix A, a script`t` may be filed and retrieved by expressions of the form`t 1!:2 <'abc'` and`t=: 1!:1 <'abc'`,`` and may be executed by the expression`0!:11 <'abc'`.
Convenient entry of scripts is provided by the phrase`0 : 0`;`` succeeding keystrokes are accepted as literal characters; the enter key that would normally terminate the entry is accepted as a fret; and the entry is terminated by a lone right parenthesis that is accepted as a final fret. For example:

       s=: 0 : 0
    y.*%:y.
    :
    x.*!y.
    )

       a. i. s                    The character with index 10 marks the end of each line
    121 46 42 37 58 121 46 10 58 10 120 46 42 33 121 46 10

Boxed and table representations of a script`s` may be obtained as follows:

       ]b=: <;._2 s               Cut on the final fret and exclude the frets
    +-------+-+------+
    |y.*%:y.|:|x.*!y.|
    +-------+-+------+

       ]t=: >b
    y.*%:y.
    :
    x.*!y.

Any one of these representations`r` may be used as the right argument to the explicit definition conjunction to produce an adverb`` (`1 : r`),`` conjunction (`2 : r`),`` or verb (`3 : r` or`4 : r`). For example:

       f=: 3 : s
       f 9                        The colon in the script separates the monadic and dyadic cases
    27

       3 f 4                      The x. and y. refer to the left and right arguments
    72

The phrases`a=: 1 : 0` and`c=: 2 : 0` and`v=: 3 : 0` provide direct entry of adverbs, conjunctions, and verbs.
Files of scripts may define functions and other entities that can serve to supplement the primaries of J. They are commonly refered to as secondary or tertiary functions according to their relative generality.

>> << Ndx Usr Pri Phr Dic Rel Voc !: wd Help Dictionary