Sponsored By

Inform 7 Substitutions, Substituted

A new version of the venerable interactive fiction authoring system Inform 7 has landed, and some of the more esoteric parts have changed. Let's help each other out.

Ron Newcomb, Blogger

May 8, 2014

2 Min Read
Game Developer logo in a gray background | Game Developer


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. 

Read more about:

Blogs
Daily news, dev blogs, and stories from Game Developer straight to your inbox

You May Also Like