Inform 7 v10.1.0 is now open-source

There does seem to be interest in using the (+ … +) notation, inside Include… text, to perform function calls to phrases defined by source text (rather than by further Inform 6 syntax); and also to be able to call functions indirectly by their addresses within inclusions, i.e., to store a function value in a variable and then call the function identified by that variable. (In I6, this has an identical syntax, but is really semantically not the same thing.)

In general, use of even “Include (- … -)” is probably best minimised, and use of “(+ … +)” within that really isn’t something we want to encourage. (This is no longer a world in which this code is just being cut-and-pasted into I6 output: we could have to compile this to C, for example. “(+ … +)” is probably the feature of I7 I most wish I’d never introduced.) Still, I’ve pushed an update which should improve things for people who need to, and particularly to help people getting old extensions to work with 10.1.

The following Basic Inform project:

To begin:
	perform the test.

To perform the test: (- beta(); -)

To expostulate mildly about (N - a number) (this is the irked function):
	say "I do think this is a pity, given [N]."

To expostulate firmly (this is the riled function):
	say "Oh really! This is too much!"

Include (-
[ alpha;
print "alpha called^";
];

[beta n plugh;
print "beta called^";
alpha();
plugh = alpha;
plugh();

((+ irked function +)-->1)(7);
((+ irked function +)-->1)(22);
((+ riled function +)-->1)();
];
-)

now compiles, and produces:

beta called
alpha called
alpha called
I do think this is a pity, given 7.
I do think this is a pity, given 22.
Oh really! This is too much!

(This is the new test case “IndirectCallsInInclusions”.)

It was also noticed in this thread that the parser used when compiling inclusions did not like I6 syntax with routine names jammed up against the opening square bracket, “[like_this”. It seemed harmless to allow this, so I’ve done so.

10 Likes