Gamasutra: The Art & Business of Making Gamesspacer
View All     RSS
October 23, 2014
arrowPress Releases
October 23, 2014
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

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

Avalanche Studios
Avalanche Studios — New York, New York, United States
[10.22.14]

UI Programmer
Avalanche Studios
Avalanche Studios — New York, New York, United States
[10.22.14]

UI Artist/Designer
Wargaming.net
Wargaming.net — Hunt Valley, Maryland, United States
[10.22.14]

Lead UI Engineer
Wargaming.net
Wargaming.net — Chicago, Illinois, United States
[10.22.14]

Lead UI Engineer






Comments


Ron Newcomb
profile image
There is also {-block} which is all-new.

Formerly when we defined a phrase with the "begin -- end" bit on the end, Inform would follow whatever your inclusion was with an opening brace, to be closed again after the indentation ended. But what if you wanted to stick a line of code after the ending brace, such as trying to create a test-at-the-bottom loop? Now we can: the code in the braces is represented by the {-block} substitution, making it easy to define your follow-on line(s).


none
 
Comment: