Inform 7 Home Page / Documentation


§22.8. Matching the names of kinds

Sometimes a phrase needs to know what kind it's to work on, but isn't going to be given any particular value of it. For example:

To assay (name of kind of value K):
    repeat with item running through Ks:
        say "There's [item].";
    say "But the default is [default value of K].";

Note that there's no hyphen, and no name for the bracketed token - it only sets K. We can then have, say:

assay colours;
assay vehicles;

But "assay texts" would throw a problem message, because we can't repeat through all possible texts. For a different reason,

assay open doors;

would not be allowed - "open doors" is a description which applies to some doors and not others; it isn't a kind. It would make no sense to talk about "default value of open door", for example.


arrow-up.png Start of Chapter 22: Advanced Phrases
arrow-left.png Back to §22.7. Kind variables
arrow-right.png Onward to §22.9. In what order?