Designer's Manual: Contents



Chapter I: The Inform Programming Language

Section 1The language of routines
1 -- First principles
2 -- Example 1: Hello World
3 -- Example 2: Elsinore
4 -- Numbers and variables
5 -- Arithmetic expressions
6 -- Arguments and return values
7 -- Example 3: Cubes
8 -- Conditions: if, true and false
9 -- Example 4: Factorials
10 -- Code blocks, else and switch
11 -- while, do... until, for, break, continue
12 -- Example 5: A number puzzle
13 -- quit and jump; saving the program state
14 -- Printing output
15 -- Example 6: Printing in hexadecimal
16 -- Built-in functions 1: random and indirect
17 -- Accepting input

Section 2The language of data
1 -- Directives and constants
2 -- Global variables
3 -- Arrays
4 -- Example 7: Shuffling a pack of cards
5 -- Seven special data structures

Section 3The language of objects
1 -- Objects and communication
2 -- Built-in functions 2: the object tree
3 -- Creating objects 1: setting up the object tree
4 -- Statements for objects: move, remove, objectloop
5 -- Creating objects 2: with properties
6 -- private properties and encapsulation
7 -- Attributes, give and has
8 -- Classes and inheritance
9 -- Messages
10 -- Access to superclass values
11 -- Philosophy
12 -- Sending messages to routines, strings or classes
13 -- Creating and deleting objects
14 -- Footnote on common vs. individual properties

Chapter II: Using the Compiler

Section 4The language of Inform
ICL (Inform Control Language); Include; conditional compilation: If..., Ifnot, Endif; Message; linking in the library; writing new modules to link in.

Section 5Compiler options and memory settings
Switches; memory sizes; typical memory usage; raising memory settings.

Section 6All the Inform error messages
Fatal errors; errors, including linker and assembler errors; warnings, including obsolete usage warnings.


Chapter III: Fundamentals

Section 7Getting started
Beginning to lay 'Ruins'; including the library files; the Initialise routine; some properties of mushrooms; name, description and initial; edible foodstuffs; introducing before and after rules; the stone steps; self-destructing rules.

Section 8Introducing messages and classes
Recap of message-sending: a parrot; classes for treasure artifacts: the pygmy statuette, the honeycomb; how clashes are sorted out in class inheritance, additivity.

Section 9Actions and reactions
Actions are attempts; generating them with <, <<; the action, noun and second variables (and inp1, inp2); the ## notation; the standard actions, in Groups 1 to 3; creating new actions, the Blorple example; fake actions like ThrownAt; how actions are processed, over 'Before', 'During' and 'After' stages.

Chapter IV: The Model World

Section 10Places, scenery, directions and the map
Giving 'Ruins' a small map; n_to, d_to, etc.; when you cant_go; scenery objects; default rules; rooms have before and after too; a mist object, present in many rooms, using found_in; the five senses and reaction rules; direction objects in the compass.

Section 11Containers, supporters and sub-objects
Containers: container, supporter, capacity, open, openable; locks and keys: locked, lockable, with_key; LetGo and Receive to trap use of a container: a horrifying chasm; the Search action; transparent objects have visible sub-objects; a television set with buttons.

Section 12Doors
How to create a door; door_to, door_dir; when_open, when_closed; a stone door for 'Ruins'; a two-way door, the 'Advent' grate; why door_dir is needed and how to trap every attempt to go through.

Section 13Switchable objects
switchable and on: when_on, when_off; the Gotham City searchlight; a sodium lamp; describe taking precedence.

Section 14Things to enter, travel in and push around
enterable objects: a slab altar; vehicles: KAR 1; special rule about the Go action when inside something enterable; the PushDir action: a huge pumice-stone ball; pushing up and down.

Section 15Reading matter and consultation
The Consult action, "look up''; consult_from and consult_words: a dictionary of glyphs, Tyndale's Bible; making "read'' and "examine'' different.

Section 16Living creatures and conversation
animate objects and the life rule; a mummified priest, Blofeld, a coiled snake; some people are transparent; orders: actions for other people; talkable objects; parsing conversation: Zen and Charlotte; untypeable verbs; fake fake actions; several voice-activated machines; applications of scope: telepathy and phone calls.

Section 17The light and the dark
Light and darkness is automatically managed; the definition of 'when there is light'; OffersLight and HasLightSource; going from darkness to darkness and the DarkToDark entry point; modifying the darkness object.

Section 18Daemons and the passing of time
Daemons and the daemon property; starting and stopping them; background daemons; timers (fuses); time_left and time_out; each_turn events for places and nearby objects; the time of day; changing it with SetTime; on the status line; midnight, sunrise, sunset; the exact sequence of events at end-of-turn.

Section 19Starting, moving, changing and killing the player
What Initialise should do; the location; initial restoration; teleportation and the PlayerTo routine; what happens when the room changes: NewRoom, initial for a room, visited; giving the player his own before rule; using ChangePlayer to transform him into any object; multi-character games; life and deadflag; the DeathMessage routine; resurrection and the AfterLife routine.

Section 20Miscellaneous constants and scoring
Story and Headline; MAX_CARRIED; the automatic rucksack SACK_OBJECT; 'amusing' rewards for the victorious; two scoring systems: MAX_SCORE, OBJECT_SCORE, ROOM_SCORE; tasks: TASKS_PROVIDED, NUMBER_TASKS, task_scores, PrintTaskName; rankings and PrintRank; automatic score notification and notify_mode; "objects'' and "places'' verbs, removable with NO_PLACES.

Section 21Extending and redefining the Library
Enriching the model; amulets and their spells; making a new library file; new common properties; changing default values of these; the LibraryMessages system for changing messages like "Dropped.''; changing the prompt; the last resort, using Replace directives; even on 'hardware' functions like random.

Chapter V: Describing and Parsing

Section 22Describing objects and rooms
print (The) obj, ... (the) obj and so on; indefinite and definite article; proper nouns; the short_name of an object; invent strings and routines; exactly how inventory lines are printed; a matchbook; describe routines; exactly how rooms are described; Locale.

Section 23Listing and grouping objects
The list-maker WriteListFrom; its style bitmap; examples: tall and wide inventories; grouping similar items together in lists: foodstuffs, Scrabble pieces and denominations of coin.

Section 24How nouns are parsed
How name is used; a fried green tomato turning red; the parser breaks text into a stream of words; wn and NextWord; reading words as numbers or from their raw text; a parse_name routine is much more flexible than name; the ParseNoun entry point; distinguishing adjectives from nouns.

Section 25Plural names for duplicated objects
Collections of indistinguishable objects; a bag of six coins; the plural property for printing out plurals; definition of 'indistinguishable'; writing parse_name routines to allow plurals to be understood; class of crowns.

Section 26How verbs are parsed
The parser's fundamental method; BeforeParsing entry point; the actor and verb word; synonyms for verbs; definitions of grammar, line and token; action_to_be; Verb directive: a simplified "take'' grammar; meta verbs; grammar creates actions; creating an "xyzzy'' verb; how to Extend grammar for an existing verb: pushing numbered buttons; priority: replace, first, last; splitting synonymous verbs apart with Extend only; the UnknownVerb and PrintVerb entry points.

Section 27Tokens of grammar
Full list of grammar tokens; prepositions; noun and held; implicit taking; tokens allowing multiple objects like "all''; filtering out nouns by attribute: "use'' verb; and by general routine: "free'' verb; parsing numbers: "type'' verb, ParseNumber; general parsing routines; reading from the parser's raw text buffer and parse table; exercises, including French, telephone and floating-point numbers, times of day, adding a third parameter to a grammar line.

Section 28Scope and what you can see
The definition of 'in scope'; touchability is stricter than scope; answering questions: "what is a grue''; scope=... tokens with programmable scope; scope_stage, ScopeWithin and PlaceInScope; changing the global definition of 'in scope' using InScope; scope_reason; looping over and testing scope; making the rules more sensitive to darkness; a long room divided by a glass wall; the add_to_scope property for component parts of containers.

Section 29Helping the parser out of trouble
Parser error messages and ParserError; ambiguity-resolution and influencing it with ChooseObjects; making "eat'' prefer edible objects; redefining "all''.

Chapter VI: Testing and Hacking

Section 30Debugging verbs and tracing
Suite of debugging verbs: "purloin'', "abstract'', "tree'', "scope'', "goto'', "gonear'', "actions'', "routines'', "timers'', "trace'', "recording'', "replay'', "random''; transcriptions; the random-number generator; Infix-format debugging files; how to crash the game interpreter at run-time; the levels of parser tracing; compiling with debugging code.

Section 31Limitations on the run-time format
Formats of the Z-machine; restrictions: memory, vocabulary, dictionary resolution, attributes, properties, names, special effects, objects, memory management, global variables, "undo'' verb, function arguments; using Abbreviate to save run-time memory.

Section 32Boxes, menus and drawings
Asking yes/no questions with YesOrNo; the status line; character graphics, escape characters; proportional- and fixed-pitch fonts, font; epigrams in boxes and box; menus of text options, DoMenu, pretty_flag, menu_item; an example menu; submenus are allowed; changing the text style to bold-face, underlining, reverse video.

Section 33Descending into assembly language
Assembly language @; reliability of interpreters; table of opcodes worth knowing about; upper and lower windows: splitting, setting the window, moving the cursor, clearing the screen, word-breaking; the colour scheme; a bell sound; keyboard reading in real-time; function and cursor keys; tokenising with dictionaries; encoding dictionary entries; input/output streams; the stack frame: throw and catch; examples: a title page, drawing status lines, formatting and centering text.

APPENDIX: Tables and summaries

Section A1Inform operators

Section A2Inform statements

Section A3Inform directives

Section A4Grammar

Section A5Library attributes

Section A6Library properties

Section A7Library-defined objects and routines

Section A8Library actions

Section A9Library message numbers

Section A10Entry points and meaningful constants

Section A11What order the program should be in

Section A12A short Inform lexicon

Contents / Back / Forward
Chapter I / Chapter II / Chapter III / Chapter IV / Chapter V / Chapter VI / Appendix
Mechanically translated to HTML from third edition as revised 16 May 1997. Copyright © Graham Nelson 1993, 1994, 1995, 1996, 1997: all rights reserved.