Gamasutra: The Art & Business of Making Gamesspacer
arrowPress Releases
May 24, 2016
PR Newswire
View All
View All     Submit Event

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 Share on Facebook    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

Telltale Games
Telltale Games — San Rafael, California, United States

Platform Engineer
War Drum Studios
War Drum Studios — Gainesville, Florida, United States

Game and Systems Programmer
Apex Systems
Apex Systems — Warren, New Jersey, United States

15+ Virtual Reality Developer Opportunities (OpenGL, WebGL, OpenCV)
Planet3 — Washington, District of Columbia, United States

Web Software Developer

Loading Comments

loader image