Computers: Universe: Keywords

Keywords are generally parameters or modifiers applied to verbs. We came across one when we examined the CREATE.FILE filename DYNAMIC command, as DYNAMIC is a keyword.

Editing a keyword reveals the following:

ED VOC DYNAMIC
2 lines long.

----: P
0001: K
0002: 241
----:

The number in the second field is provided to whichever verb is being run, which understands it and modifies its behaviour accordingly. As keywords work by numbers in this way, they are not terribly interesting to edit.

One peculiarity, though, is that some words which are usually used as keywords may also be used as verbs in their own right. An example is the DISPLAY command we have used in many examples to date. The VOC record for DISPLAY looks like this:

ED VOC DISPLAY
3 lines long.

----: P
0001: K
0002: 258
0003: DISPLAY.VERB
----:

This indicates that the word DISPLAY has two entirely separate uses. If used as a keyword following some other verb, it is keyword 258: and it is up to the verb in question what to do if this keyword is specified. On the other hand, if used as a command in its own right, as in DISPLAY Hello mum!, the UniVerse command on the third line is executed instead. Editing this in turn reveals an ordinary verb.

ED VOC DISPLAY.VERB
4 lines long.

----: P
0001: V
0002: DISPLAY
0003: I
0004: GHNK
----: