Inform 7 Home Page / Documentation


§6.4. Defining new adjectives

Suppose we want to coin a word for supporters currently supporting something. We can do so with the following sentence:

Definition: A supporter is occupied if something is on it.

Note the colon, which is essential, and the usage of "it" in the definition part to refer to the object in question. (For this purpose we would write "it" even if we were defining a term about, say, a woman instead of a supporter, so that "she" or "her" might seem more appropriate - but see below.)

This creates the adjective "occupied", and gives it a definition valid for supporters. That restriction on validity means that non-supporters would always fail the description "something occupied"; which might be unfortunate if we wanted to talk about rooms being occupied. We could give a second definition thus:

Definition: A room is occupied if a person is in it.

These are entirely different senses of the word "occupied" - a mantelpiece is occupied if an invitation is on it, but for a drawing room to be occupied there must be human presence - and Inform applies whichever sense is relevant when deciding whether or not a given object is "occupied".

Often, though not always, we also want to give a name to the opposite possibility. We can do that as follows:

Definition: A room is occupied rather than unoccupied if a person is in it.

The "rather than..." part of the definition is optional, but it saves having to write a boringly similar definition of "unoccupied" out in longhand. (Note that Inform does not guess the meaning of "unoccupied" unless it has been explicitly told it. Such guesses are too risky, when so many "un-" words fail to conform to this pattern: "unified", "uncle", "ungulate" and so on.)

Newly defined adjectives cannot be used when creating things, because they are not explicit enough. Inform could not satisfy:

The Ballroom is occupied. The bucket is a large container.

because there is not enough information: by whom is the Ballroom occupied? How large, exactly? On the other hand, newly defined adjectives are very helpful in conditions and for rules, as we shall see later on.

It is occasionally clumsy having to refer to the subject of a definition using "it". We can avoid this and give the definition better legibility by supplying a name instead. For instance:

Definition: a direction (called thataway) is viable if the room thataway from the location is a room.

which is a good deal easier to read than

Definition: a direction is viable if the room it from the location is a room.

* See New conditions, new adjectives for giving more extensive definitions of new adjectives, using phrases


arrow-up.png Start of Chapter 6: Descriptions
arrow-left.png Back to §6.3. Sources of adjectives
arrow-right.png Onward to §6.5. Defining adjectives for values

*ExampleFinishing School
The "another" adjective for rules such as "in the presence of another person".