Gamasutra is part of the Informa Tech Division of Informa PLC

This site is operated by a business or businesses owned by Informa PLC and all copyright resides with them. Informa PLC's registered office is 5 Howick Place, London SW1P 1WG. Registered in England and Wales. Number 8860726.

Gamasutra: The Art & Business of Making Gamesspacer
arrowPress Releases

If you enjoy reading this site, you might also want to check out these UBM Tech sites:


Inform 7 Substitutions, Substituted

by Ron Newcomb on 05/08/14 10:08:00 pm

1 comments Share on Twitter    RSS

The following blog post, unless otherwise noted, was written by a member of Gamasutra’s community.
The thoughts and opinions expressed are those of the writer and not Gamasutra or its parent company.


When I explained to my wife why yesterday was such an important day -- a new version of Inform 7 released -- I had to make the analogy that three Christmases have come and gone in the time since the last time this happened. Only then did she let me have some time to myself so I could spend some time where I'm happiest: under the hood of a very nifty compiler. 

Authors of extensions have a particularly lot to do for the new build, 6L02.  The new reponses system means that even the least technical of extensions has some updating to do.  But here I'm concerned with the more technical ones, the ones which rely on interfacing with the underlying Inform 6.  This is an area that isn't documented as well, so, in the spirit of Emily Short's posts on how to quickly update an extension, I'd like to cover a few changed "substitutions", as they're called in the manual.

First is the counters set, seen in Chapter 26, section 29. The docs still have their old names of {-allocate-storage:x} and {-advance-counter:x} and I presume the docs will be updated soon.  Til then, these merely have the new names {-counter-makes-array:x} and {-counter-up:x} presumably to make it more obvious that they work with {-counter:x} as a set. 

The second substitution is used when dealing with block values, called reference types in programming-language speak. The old nuts-and-bolts {-pointer-to:x} has been replaced with the more hoity-toity {-by-reference:x} even though they mean the same thing to everyone except your Comp Sci teacher who insists that pointers don't exist in Java.

Finally, the most interesting of the lot.  Whenever a phrase accepts a table as one of its arguments, its definition contained a {-require-ctvs} as a directive to Inform 6 to create two local variables to be used by the template layer, ct_0 and ct_1.  But now we have a more general mechanism, {-my:x}, which can create as many local variables as we'd like.  So the new build might have both {-my:ct_0} and {-my:ct_1} as the replacement.   

There's surely more changes in the substitution system.  If you know of any not listed here, please leave a comment. Someone will thank you for it. 

Related Jobs

Insomniac Games
Insomniac Games — Burbank CA or Durham NC, California, United States

Mid to Senior Engine Programmer (Tools)
Insomniac Games
Insomniac Games — BURBANK, California, United States

Character TD (Rigger)
LOKO AI — Worldwide, California, United States

Senior Unreal Engine Developer
Free Range Games
Free Range Games — Sausalito, California, United States

Senior Engineer (Unreal)

Loading Comments

loader image