Chapter 2: The Source Text
2.3. Punctuation

The example rule just given demonstrates one of Inform's conventions about punctuation, and is worth pausing to look at again.

Instead of taking the crate, say "It's far too heavy to lift."

In English grammar, it's usual to regard a full stop as closing its sentence even when it occurs inside quotation marks, provided there is no indication to the contrary, and this is also the rule used by Inform. Thus:

The description is "Shiny." It is valuable.

is read as equivalent to

The description is "Shiny.". It is valuable.

Sentence breaks like this occur only when the final character of the quoted text is a full stop, question mark or exclamation mark (or one of these three followed by a close bracket) and the next word begins, in the source code, with a capital letter. A paragraph break also divides sentences, behaving as if it were a full stop.

Text in square brackets [like so] is "comment", in computing jargon: it is considered as being an aside, a private note by the author, and not read in by Inform. This allows us to make notes to ourselves like so:

The China Shop is a room. [Remember to work out what happens if the bull gets in here!]

Double quotation marks can't be used in text, because they would end the piece of text then and there. Instead, we use single quotation marks:

Instead of taking the crate, say "Simon says, 'It's far too heavy to lift.'"

Inform will automatically convert the speech marks to double-quotes when it prints, resulting in:

Simon says, "It's far too heavy to lift."

Note that apostrophes inside words, such as the one in "it's", remain apostrophes. This is a rule which sometimes goes wrong. In:

Instead of going outside, say "Lucy snaps, 'What's the matter? You don't trust my cookin' mister?'"

the apostrophe at the end of "cookin'" is wrongly made into a double-quote. We can get around this by writing:

Instead of going outside, say "Lucy snaps, 'What's the matter? You don't trust my cookin[apostrophe] mister?'"

which shows another punctuation convention of Inform: inside quoted matter, like the line being said here, square brackets are used to describe what to say without giving the literal text. We shall see many more usages of this convention in later chapters.

For now, this seems the place to mention just two other points: ['] is a convenient abbreviation for "[apostrophe]", and has the same effect; and "[quotation mark]" makes a double-quote, but ["] is not allowed.

As these examples begin to show, Inform source imitates the conventions of printed books and newspapers whenever there is a question of how to write something not easily fitting into words. The first example of this is how Inform handles headings, but to see why these are so useful we first look at Problems.


PreviousContentsNext