Inform 7 Home Page / Documentation
§18.13. Listing contents of something
1. When it happens. When taking inventory, the list is produced by the activity "listing contents of yourself"; when looking, a list of items which do not deserve their own paragraphs is produced by "listing contents of" the location.
And when it doesn't happen. (a) If the Storage Room contains a sideboard and an open shoe box, then "listing contents of the Storage Room" is used to produce the part of the room description mentioning sideboard and box. But if the box in turn contains a pair of brogues, then "listing contents of the shoe box" is not used to say that part. So this works:
Rule for printing the name of the brogues while listing contents of a room: ...
But this won't affect room descriptions:
Rule for printing the name of the brogues while listing contents of the shoe box: ...
(b) The activity also doesn't happen when, for instance, "[a list of animals]" is printed, because that isn't a list of the contents of any room or location.
2. The default behaviour. The list is printed out.
3. Examples. (a) We have already seen that it can be elegant to elaborate on a description in the context of a list. Here we add "discarded" to a sweet wrapper which is found on the ground.
Rule for printing the name of the wrapper while listing contents of a room: say "discarded sweet wrapper".
(b) Lists can be considerably shortened and tidied up if similar items are grouped together. We do this by specifying what should be grouped together before listing contents, using the special phrase "group ... together":
Utensil is a kind of thing. The knife, the fork and the spoon are utensils. Before listing contents: group utensils together as "utensils".
The result will be, say, "two utensils (knife and spoon)", if both are found in the same place.
(c) We can less obtrusively group items together like so:
Before listing contents while taking inventory: group utensils together.
Three special phrases exist for this kind of list organisation:
group (description of objects) together
This phrase causes the objects described to be listed together in a single item as part of an inventory or room description. The effect is temporary, and the phrase should only be used when this list is imminent. Example:
Utensil is a kind of thing. The knife, the fork and the spoon are utensils. Before listing contents: group utensils together.
This might produce the list item "fork and spoon".
group (description of objects) together giving articles
This phrase causes the objects described to be listed together in a single item as part of an inventory or room description, but giving each individual item its indefinite article. The effect is temporary, and the phrase should only be used when this list is imminent. Example:
Utensil is a kind of thing. The knife, the fork and the spoon are utensils. Before listing contents: group utensils together giving articles.
This might produce the list item "a fork and a spoon".
group (description of objects) together as (text)
This phrase causes the objects described to be listed together in a single item as part of an inventory or room description, summarised with the given text. The effect is temporary, and the phrase should only be used when this list is imminent. Example:
Utensil is a kind of thing. The knife, the fork and the spoon are utensils. Before listing contents: group utensils together as "utensils".
This might produce the list item "two utensils (fork and spoon)".