Inform 6.30
Inform 6.30 was released on 28th February 2004.
Features added
-
The compiler automatically defines a WORDSIZE constant, whose value is 2 when compiling for the Z-machine, and 4 when the target is Glulx. The constant specifies the number of bytes in a VM word, and we recommend that you use it in the small number of circumstances where this value is significant. The compiler also defines a constant TARGET_GLULX if you supply the -G switch, or TARGET_ZCODE otherwise; in both cases the constant value is 0. For more information on the use of these constants, see Support for Glulx.
-
The Switches directive, which enables certain compiler switches to be set from within the source file rather than on the compiler command line, has been superseded by a more powerful mechanism. The special comment characters “!%”, occurring on the very first line or lines of the source file, enable you to specify Inform Command Language (ICL) commands to control the compilation. For example:
!% -E1G ! Glulx, 'Microsoft' errors !% -~S ! disable Strict mode !% +include_path=./test,./,../lib/contrib ! look in 'test' library !% $MAX_STATIC_MEMORY=20000 Constant STORY "RUINS"; ...
-
ICL is described in §39 of the Inform Designer’s Manual. In brief: each line specifies a single command, starting with “-” to define one or more switches, “+” to define a path variable, or “$” to define a memory setting. Comments are introduced by “!”. The ICL command “compile” is not permitted at the head of a source file.
-
Two new ICL memory settings are available; both of these could previously be changed only by rebuilding the compiler. $MAX_SOURCE_FILES has a default of 256, and $MAX_INCLUSION_DEPTH has a default value of 5.
-
A new directive, similar to Array ... string and Array ... table, is provided:
Array array buffer N; Array array buffer expr1 expr2 ... exprN; Array array buffer "string";
This creates a hybrid array of the form used by string.print_to_array() and the new library routine PrintToBuffer(), in which the first word array-->0 contains N and the following N bytes array->WORDSIZE, array->(WORDSIZE+1) ... array->(WORDSIZE+N-1) contain the specified expression values or string characters.
-
A new (A) print rule — similar to the existing (The) — prints an object’s indirect article with its first letter capitalised. The printed article is “A” or “An” by default, or else taken from the object’s article property.
-
The minimum size of the Z-code header extension table can be set using the command line switch -Wn. For example, -W6 makes the table at least six words long.
-
Source code in character sets other than ISO 8859-1 to 8859-9 is now supported, provided that the character set can be mapped onto one of the ISO 8859 sets.
A mapping file is used to define how the source code is to be processed. This file consists of a directive indicating the ISO 8859 set to be mapped to, followed by 256 numbers giving the mapping. As an example, under Microsoft Windows, Russian text is encoded with the character set defined as Microsoft code page 1251. The following text defines a mapping to the ISO 8859-5 set:
! Windows Cyrillic (code page 1251) to ISO 8859-5 C5 0, 63, 63, 63, 63, 63, 63, 63, 63, 32, 10, 63, 10, 10, 63, 63 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95 96, 97, 98, 99,100,101,102,103,104,105,106,107,108,109,110,111 112,113,114,115,116,117,118,119,120,121,122,123,124,125,126, 63 162,163, 44,243, 34, 46, 63, 63, 63, 63,169, 60,170,172,171,175 242, 39, 39, 34, 34, 46, 45, 45,152, 84,249, 62,250,252,251,255 32,174,254,168, 36, 63,124,253,161, 67,164, 60, 63, 45, 82,167 63, 63,166,246, 63, 63, 63, 46,241,240,244, 62,248,165,245,247 176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191 192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207 208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223 224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239
Lines starting with “!” are treated as comments. The next line, beginning with “C”, defines the ISO set to map to in the same way as the -Cn command line switch.
To use the mapping, Inform treats each character in the source file as a number between 0 and 255, and uses that number as an index into the mapping table. For example, suppose that the character read in from a Russian Windows text file is the Cyrillic small letter “ya”.This character is represented in the Russian Windows character set by the number 255. Inform takes the 255th entry in the mapping, which is 239. Therefore the character is regarded as being 239 in ISO 8859-5.
The name of the mapping file is specified by a new compiler path variable +charset_map. If the above mapping is held in a text file win1251.map, a Russian game could be compiled with a command line of the form:
inform +charset_map=win1251.map +language_name=Russian mygame.inf
-
The
@check_unicode
and@print_unicode
opcodes, introduced in the Z-Machine Standards Document version 1.0, can now be called by name rather than by using the clumsier generic syntax@"EXT:11S"
and@"EXT:12S"
. For example:@print_unicode $0401; ! Cyrillic capital letter IO
-
Strict mode (which compiles run-time integrity checks into your game) has been decoupled from Debug mode (which defines debugging verbs like TRACE and SHOWOBJ). This means that it’s no longer necessary to turn off Strict checking (in order to disable the Debug verbs) before releasing a game, though of course you can do so if you wish to save space and increase performance. By default, Strict mode is enabled (turn it off with -~S) and Debug mode is disabled (turn it on with -D).
-
The compiler now issues a warning if you use array->n on an array of words, or array-->n on an array of bytes. Use the new Array ... buffer directive to create a hybrid array which can be accessed without these warnings.
-
The compiler also issues a warning if you refer to an unqualified property name within a routine, for example by typing (number==0) when you intended (self.number==0).
-
Another new warning appears if you include something other than a dictionary word in an object’s name property. This is most commonly triggered if you try to add a single-letter word by typing name 'g' 'string' when you intended name 'g//' 'string'.
Bugs fixed
-
A problem with multiple assignment involving pointer arithmetic in Strict mode giving the wrong answer has been fixed.
-
After using Extend only to separate off an element of an existing Verb definition, new synonyms for the separated verb now work correctly; previously they were applied to the residue of the original definition.
-
Strict mode now tests for the use of
@put_prop
or@get_prop
opcodes when a common property is longer than two bytes — the Z-Machine Standards Document says that this is illegal, and that the result is unspecified. The error message is of the form “[** Programming error: obj (object number N) has a property prop, but it is longer than 2 bytes so you cannot use "." to read **]”. This means that you have used the obj.prop construct in the situation where prop is a common property containing two or more values; typically prop is being explicitly used as an array, or it’s an additive property and both obj and its parent class have defined values for it. The problem does not occur if prop is an individual property. -
Handling of European quotes is (finally) correct: the “«” symbol is produced by any of
@<<
,@@163
and@{00AB}
, while any of@>>
,@@162
and@{00BB}
produce the matching “»”. Note, however, that this problem originated in an error in the previous version of the Z-Machine Standards Document, and therefore older interpreters written to that specification, or more recent ones adjusted to work with the incorrect fix introduced at Inform 6.12, may still not give the correct results. -
The “no such constant” compilation error message now quotes the number of the appropriate source line.
-
The metaclass() and ZRoutine() routines no longer report large unsigned values — above the game’s Static memory area — as of type String. More usefully, the constant NULL (-1) is not reported as a String.
-
Complex expressions combining a routine call and the ofclass and or operators no longer generate incorrect code.
-
Negative constants in assembly operations — for example,
@set_colour 4 (-1);
— no longer cause the compiler to report an unexpected expression. -
Various problems with handling ISO 8859 characters in the range 128-255, and also in the use of
@@
escape sequences, have been resolved. -
An Abbreviate directive containing a substring of “” may crash the compiler; hopefully, no more.
-
The 320Kb size limit placed by Inform on v6 and v7 games has been raised to 512Kb.
-
Following a Zcharacter directive replacing the entire alphabet table, dictionary entries are no longer corrupted.
-
The compiler now generates conditional branches spanning up to 63 bytes, lifting the previous unnecessary limit of a 31-byte span and leading to slightly shorter code.
-
Putting an object in itself doesn’t now loop indefinitely.
-
Various problems with the
@store
,@inc_chk
,@dec_chk
,@not
and@je
opcodes have been resolved. -
Problems with nested conditional compilation directives #Ifndef...#Ifnot...#Endif have been resolved.
-
A long dictionary word — such as 'elephants//p' — now correctly sets the plural bit.
-
Problems with constant folding — that is, having the expression evaluated at compile-time — partly addressed in the previous bi-platform compiler, have been fixed.
-
When compiling for Glulx, the compiler uses the
@callf
,@callfi
,@callfii
or@callfiii
opcodes where applicable for generated calls instead of always pushing arguments onto the stack and using@call
. -
The presence of a Switches G; directive no longer causes the compiler to crash.
-
An unexpected limit of 1024 labels per routine in the Z-machine assembly language generated by the compiler has been raised to 32768. The most likely way to encounter this limit is by creating a switch statement with an extremely large number of cases.
-
A problem with the read statement generating the wrong opcode in a version 4 game has been corrected.
-
A dynamic class declaration such as Class Pebble(NUM_PEBBLES) ... ; no longer creates a mysteriously large number of instances if NUM_PEBBLES isn’t defined.