[I7] Default messages redux
Graham Nelson
graham at gnelson.demon.co.uk
Sun Feb 17 11:05:04 CST 2008
Dear David,
Those all sound like eminently sensible changes.
I agree on the removal of the library messages for
defunct actions such as Swim, and indeed have
just done something similar at this end.
I now have a setup in which:
- the entire I6 library is merged into the "template
layer", with the language definition file as "Language.i6t",
one file from it - thus library 6/11N is no more, and
the overall architecture of I7 is a little simpler;
- a translation is now an I7 extension which makes
use of the much-souped-up Include (- ... -) syntax
to rewrite Language.i6t;
- the example included in the built-in distribution,
"English by David Fisher", is not (currently) used
during default runs because it duplicates the
effect of the built-in version: it's meant to be a
model which other languages can imitate.
(I append the current change log below.)
A few messages which I missed earlier have been
added to LibraryMessages in Language.i6t,
but there were only a couple of these.
I think the logical next steps would be:
(a) to get you my current version, by prevailing
on David (K.) once again;
(b) for you to see if it is possible to alter
English by DF in such a way as to produce
library messages via text substitutions, etc.,
as in Custom Library Messages;
(c) finally, to move these messages into a
Table of Messages with special powers,
as we discussed earlier - that part being back
to me again;
(d) once (c) is achieved, we should verify this by
checking that every test produces the same
text output using the existing language definition
file versus using English by David Fisher -
intest can do this;
(e) we then make English by David Fisher the
default way of doing things, and get rid of the
old LibraryMessages altogether.
Does that seem a viable way forward?
Graham
PS. The current categorisation of tests is a
historical accident, to some extent, but you could
always add a new category for your own intest
cases: you only need to add a folder in parallel
to the ones like Test Cases, and to add the
details to the intest-configuration file.
NEW FEATURES
It is now possible to define two different versions of the same text
substitution, one in which the first letter is capitalised, the other
in which it is lower case: these then have different meanings. (Inform
already did this where the first word was The, A or An, and used this
so that "[the noun]" had a different effect from "[The noun]": what
is new is that the same rule now applies to any first word.)
When creating new verbs or prepositions, the word "reversed" can be used
to reverse the sense of a relation. For instance,
The verb to be embedded in implies the reverse incorporation relation.
The verb "to incorporate" has been added to the built-in stock; that
is, the
following is now part of the Standard Rules:
The verb to incorporate (he incorporates, they incorporate, he
incorporated, it is incorporated, he is incorporating) implies the
incorporation relation.
Thus X incorporates Y if and only if Y is a part of X. It was slightly
anomalous that no such built-in verb existed already (analogous to
"to contain" and "to support"), and several extension-writers have
found it a useful linguistic device and had to define it themselves.
A new activity "printing the announcement of light" has been added, in
parallel with "printing the announcement of darkness".
The assertion-maker has been slightly improved, so that relative clauses
like the one in the third sentence here work (rather than producing
problem messages):
A person can be asleep or awake. The Spinning Tower is a room.
Sleeping Beauty is a woman who is asleep in the Spinning Tower.
Test scripts (for TEST) can now contain exotic characters, and follow
the same apostrophe conventions as other text: thus ' becomes " except
where used as a contraction, but ['] forces a genuine single quote.
The meaning of the phrase
place X in scope
used to depend on whether X was a room or not: for rooms, only the
contents would be put in scope, and not X itself. This meant there
was no way to put the actual names of rooms in scope, and was in any
case an unnecessary complication. As from this build, the following
possibilities:
place X in scope
place X in scope, but not its contents
place the contents of X in scope
do what they appear to suggest, whether X is a room or not. (If X is
a room, the new "place the contents of X in scope" does exactly what
the old "place X in scope" did, so it should be easy to correct
existing
source text if necessary - but e.g. in the Inform examples we didn't
need to make any corrections at all.)
EXTENSIONS
Headings can now provide source text to be used if a given extension is
included in the current run; or alternatively, if it isn't. For
instance:
Chapter 2a (for use with Locksmith by Emily Short)
specifies that everything under this heading (and its subheadings, if
any)
will be ignored unless the extension Locksmith by Emily Short is
included.
Conversely,
Chapter 2b (for use without Locksmith by Emily Short)
will be ignored unless it isn't included.
This allows extension writers to give variant implementations depending
on what other extensions are in use.
Headings can also replace portions of extensions which have been
included.
For instance:
Section 6 - Hacked locking (in place of Section 1 - Regular locking in
Locksmith by Emily Short)
places the source text under the new heading in the place of the old
(which is thrown away). If there should be two or more headings of the
same name in the given extension, the first is the one replaced;
if two or more headings attempt to replace the same heading in the
given extension, the final attempt in source text order is the one
which succeeds; and finally, heading dependencies like the above are
scanned in a top-down way. Thus, if we have
Chapter 2a (for use with Locksmith by Emily Short)
...
Section 1 - Hacked marbles (in place of Section 4 in Marbles by
Peter Wong)
...
and we don't include Locksmith, then the replacement of Section 4 of
Marbles is not made, because Section 1 - Hacked marbles is subordinate
to the Chapter 2a heading which we've told Inform to ignore.
The extensions machinery has been made more robust, fixing a number of
obscure bugs not actually experienced in practice by any users, and
changing existing conventions as follows:
- It is now possible for an extension to contain accented characters
in author name and title: thus,
Include Étude Pour La Fênetre by Françoise Gauß.
should work. (Accents are removed for console output; the file of
the extension must have the actual name it claims, as with any other
extension.)
- The maximum lengths of extension title and author name, previously
31 characters each, have been raised to 50 characters each: but these
are now more rigorously checked. (Previously, an extension breaking
these limits would work on some platforms but not others: it would
produce installation error messages on the Extensions documentation
page, but these were easy to overlook by accident. An extension with
overlong title or author name will now produce a Problem message when
included.)
- Installation errors are now more prominently displayed on the
Extensions documentation page.
- Problem messages added and improved for checking that 'begins here'
and
'ends here' sentences for extensions being used are correct. (Checking
of 'ends here' sentences, in particular, was very lax previously
because
of a bug in the extension manager: apologies for this, because it means
there are now a few extensions in circulation which have improperly
written 'ends here' sentences, but which are otherwise correct, and
will now be rejected. But the corrections needed will be very simple.)
INTERNAL REFORMS
The Standard Rules have been revised throughout: they are now more
logically
constructed, easier to read and better presented (for instance, in the
Phrasebook index, which has a slightly new look). They advance formally
to version 2.
While much altered internally, they are almost exactly the same from
the
user's point of view, except that:
- The property "inventory listing" for things has been withdrawn.
(A fossil from the days of Inform 6: in I7's more rule-oriented way of
looking at things, gadgets like this one are more an obstruction than a
help, and it was striking that not one of the hundreds of examples ever
used this property. And users often found it misleading that the
property
didn't play well with the activity "printing the name of something".)
- The either/or property "transparent/opaque" is now a property only of
containers, not of all things. (It only ever had any effect for
containers anyway, and for some things it makes no good sense - a
transparent animal is perhaps a jellyfish, but a transparent man, in
the non-metaphorical sense?)
- The either/or property "enterable" is now a property only of
containers
and supporters. (Again, it did nothing for any other things before.)
- An action which fails because the player is in darkness, and it needs
light, is now deemed to fail the "basic visibility rule", not the
"can't
act in the dark rule". (This brings it into line with the "basic
accessibility rule", which is given as the reason for failure when the
actor cannot touch something which is required to be in reach.)
- The somewhat vaguely named "non-player character action rule" is now
called the "requested actions require persuasion rule".
- Implicit taking has been reformed: in past builds, the implementation
of the taking action looked as if implicit takes were unlike ordinary
actions, but this wasn't really so. The action variable "thing
implicitly
taken" has been abolished, and so have the following three rules:
standard set taking variables rule
avoid unnecessary implicit taking rule
don't report successful implicit takes rule
Four obscure variant syntaxes, intended primarily for use by the
Standard
Rules, have been combined into one. The following examples show the
change:
Open translates into Inform as open.
--> The open property translates into I6 as "open".
The I6 library object name of yourself is "selfobj".
--> The yourself object translates into I6 as "selfobj".
The adjust light rule corresponds to routine ADJUST_LIGHT_R.
--> The adjust light rule translates into I6 as "ADJUST_LIGHT_R".
Quitting the game is an action corresponding to Quit, out of world
and applying to nothing.
--> Quitting the game is an action, out of world and applying to
nothing.
The quitting the game action translates into I6 as "Quit".
In addition, one can now write:
The whatever variable translates into I6 as "whtvr".
which was not previously possible to specify.
Problem messages have been added to defend this combination verb
better against malformed requests, though it is still intended only for
low-level extensions.
(As a result, "to correspond" is no longer reserved and people can
define this as a verb of their own now; "to translate", of course, is
still reserved. The "I6 library object name" property has been
abolished.
Old-style tabular action definitions, in terms of lists of I6 routine
names,
have also been withdrawn.)
I7 projects no longer use the old I6 library: for fifteen years now,
every
story file made by Inform has included "Parser.h", "VerbLib.h" and
"Grammar.h", but no longer. This is not as momentous as it sounds.
I7 began by using library 6/9, then adapted to 6/10 and 6/11, but it
always required minor modifications, indicated the suffix "N": thus,
the latest releases of I7 have used library 6/11N. This was intended
for dual use by I6 and I7 projects, but I7's use of the library had
become increasingly strained. In 5J39, library 6/11N contained around
400 conditional compilations causing it to produce different code when
used by I6 and I7: in some cases, drastically different. Almost half of
the lines in 6/11N were ignored by I7, as were many of the concepts
and features familiar to I6 users. It seemed to the authors that 6/11N
was living a lie: it wasn't really the same library when used by both
systems, and the continuing pretence was only making the code more and
more baroque. Its form was only holding back further development.
In this new build, the material from 6/11N which was still in use has
been moved into the "template layer", where it joins the other I6
code used by I7. This somewhat simplifies the I7 architecture.
Library 6/11N is still included in the current build, for the benefit
of anyone using it with purely I6 projects in the Inform 7 user
interface.
In any case much of the significant code in the I6 library lives on,
almost
unmodified, in a new home. "Parser.i6t" in the new template, for
instance,
is more or less the supposedly abandoned "parserm.h" from Library
6/11N.
The I6 library is dead; long live the I6 library.
The template layer consists of a set of more than 20 mainly short
files, or
"segments", with the extension ".i6t". Each segment has a name and is
divided up into one or more named parts.
This has enabled the Include (- ... -) syntax for inserting raw I6 code
to be considerably strengthened. For instance -
Include (- ... -) before "Flowers.i6t".
Include (- ... -) instead of "Flowers.i6t".
Include (- ... -) after "Rhizomes" in "Flowers.i6t".
With these new forms of Include, the given I6 code can be placed
before,
instead of, or after any named segment or named part of a segment.
- Multiple such inclusions can be made for the same segment or part,
and
if so, all will take effect;
- Inclusions requested before, or after, a segment or part which has
been
replaced with "instead of" will take effect and appear before or after
the code which appears instead of it.
- The existing but deprecated syntax
Include (- ... -) before the library.
has been withdrawn; the new syntax
Include (- ... -) after "Definitions.i6t".
should have the same effect.
- The existing (and still fine!) syntax
Include (- ... -).
is, for what it's worth, equivalent to
Include (- ... -) after "I6 Inclusions" in "Output.i6t".
- Template code can now use the same (+ ... +) notation to evaluate I7
expressions that inline definitions can; they also have access to a
wide
range of internal-use-only commands which shouldn't be used except in
the built-in template files, but one command is safe to use:
{-segment:NAME}
places the whole of the template file NAME in this position. The file
should be named as something like "MyStuff.i6t" -- it's a leafname, not
a pathname -- and Inform looks for template files first in the
subfolder
"I6T" of a project's "Materials" folder, if that exists, and only then
in its built-in stock. This means that
(a) you can if you wish replace the built-in templates with your
own, putting those in Materials/I6T, and
(b) you can if you wish include chunks of I6 code generated by
external utilities - Perl scripts, lex and yacc, etc. - by compiling
those to suitable template files in Materials/I6T and then using
an inclusion like
Include (- {-segment:MyStuff.i6t} -).
All this allows for fine control in modifying the template, though we
hope
that users won't go in for template modification much or often.
The template layer is gradually being tidied up: an annotated version,
explaining what each part does, will be published later this year. In
the mean time, those who do hack the template are warned that they may
need to alter their code to keep it working with future builds.
One application of template layer hacking might be to provide extensions
which translate the language of play. At present, I7 is not
configurable
enough to translate the language of writing, but as from this build it
should be much more viable to translate the language of the story file.
To demonstrate this, a new extension, "English by David Fisher", is
built in. This extension implements English, and there's no need for
anyone to include it in their story files since English is already the
language of play by default: but it serves as a model which translators
can imitate. It should be fairly straightforward to convert existing
I6 language definition files into extensions following this model.
The authors suggest that these could be named in the style "Language
by Translator's Name" - say, "Latin by Adam Thornton".
Bug fixed whereby if a character were asked to do something with
multiple
objects (say with the command HELEN, GET ALL) then it would be assumed
that agreement to perform the action with the first item would extend
to the rest of the list, too. Persuasion rules are now properly checked
for each item in the list in turn.
Bug fixed whereby some extension namespace clashes would fail to be
reported correctly on the dictionary page where three or more
different extensions all defined the same term.
Bugs fixed whereby names with exotic ingredients such as ~, ^, @ would
either be misprinted or misparsed, or both.
Bug fixed whereby paragraph breaks in the middle of phrase definitions
would sometimes incorrectly be allowed, if the material just before
the paragraph break ended in a semicolon.
Bugs fixed, or really, syntax clarified as to when qualifiers such as
"always" and "usually" can be used in assertions: these are allowed
on either side of the verb in most assertions, but not on both (for
which a problem message has been added), and not in assertions
admitting no doubt (such as "Looking is an action applying to
nothing").
Previously Inform would silently allow, though ignore, some such
usages.
Similarly, "worn", "carried" and "here" can now only be used in
assertions
using the verb "to be".
Similarly, "of", "from" and "and" now lose their grammatical meanings as
introducers of clauses in assertions if they are unexpectedly written
with an upper-case O, F or A, respectively. Thus
On the shelf is Of Mice And Men and The Girl From Ipanema.
places two objects on the shelf, with the obvious names, and doesn't
get sidetracked into thinking the shelf contains (for instance) an
item called "Of Mice" together with some "men".
Problem message added for creating a property name consisting only of
the
word "presence" (since this causes ambiguities with "...in the presence
of...").
Bug fixed whereby names containing "from" would sometimes have their
original
articles taken as part of the name itself: for instance,
The telegram from Klaxor is in the Breakfast Nook.
would produce a proper noun, "The telegram from Klaxor", rather than
parsing it as "the" (definite article) + "telegram from Klaxor". (That
this bug was not more widely felt is chiefly because another mechanism
in Inform tended to compensate for it.)
Bug fixed whereby "called" names were sometimes unable to contain the
words
"with" or "having": for instance, this failed -
The golf ball is in a container called the flask and cap with flange.
Bug fixed whereby consecutive articles would on rare occasions be
allowed
in noun phrases ("a the tree", say).
Examples:
"Provenance Unknown" added to demonstrate how PUSH TELEVISION WEST
might
be converted to pushing the cart on which the television rests.
Changes to "Alias", "Air Conditioning is Standard", "A Haughty Spirit",
and "Dinner is Served" to reflect new strictness about properties
such as enterable and transparent. (These were all effectively minor
bugs that had previously gone unnoticed.)
Changes to "What Not To Wear", to reflect new strictness and to make
some running speed improvements. More speed improvements are
necessary.
Extensions:
"Locksmith" edited to make it easier to change the output text; version
number advanced to 6.
"Plurality" advanced to version 6, and a bug fixed whereby is-are did
not
print the correct output in the case where the object was the player.
--
Graham Nelson
More information about the Inform7-porters
mailing list