[I6] Where is the routine underlying print (address) functionality?

Roger Firth’s Inform 6 FAQ makes an apparently outdated reference to a routine RT__ChPrintA() as the actual routine behind the print (address) ... printing rule, but no routine of that name is defined anywhere in Standard Library 6/11 or 6.12.4. Does it still exist under a different name somewhere?

It’s part of the compiler veneer:

1 Like

Thank you very much, @Dannii. Perhaps the reference in the FAQ wasn’t outdated… it just didn’t mention that the routine was in the compiler code instead of the Standard Library.

I see that print (string) ... and print (char) ... and metaclass() and all of the other things that I’ve been looking for are in veneer.c, too, so thank you times several!

doing a quick test: (non-*nix people: the lack of *grep output means “no such string”)

~/if/lib/i6$ rgrep RT__ChPrintA
~/if/lib/i6$ 

~/if/lib/i5$ rgrep RT__ChPrintA
~/if/lib/i5$ 

the two dirs contains, in separate sub-dirs, for I6, library 6.01, 02, 11, 12, 12-1, 12-2, 12-2a 12-3, 12-4.1 and for I5, library 5.0, 5.2, 5.5, 5.8, 5.9, 5.11, 5.12 plus all I5 and I6 contribs from the If-Archive.

How and why Firth’s faq cite this apparently non-extant routine, is a mystery for me, albeit I admit not having libraries 6-03 to -10 around for quick grepping…

Perplexed regards from Italy,
dott. Piergiorgio.

Correct, it’s not found in the Standard Library at all. Like Dannii said, these are part of the compiler’s veneer code (laid out in file veneer.c in the Inform compiler source code). It seems that the compiler automatically adds these routines to any compiled program.

Fascinatingly, these veneer routines can be replaced in your own source code with the Replace directive, so it’s possible to substitute your own version of print (char) ..., print (address) ... and the like.

1 Like

This was the original reason for the Replace directive, I believe. It was extended over time to support Replacing library routines, and then routines anywhere.

1 Like

To be extremely fussy, the compiler adds these to any compiled program that needs them. If you compile a program with no print (char) statements, then RT__ChPrintC() will be omitted. It will also be omitted in non-strict mode (the -~S option), because RT__ChPrintC() is the strict-checking version of print (char).

2 Likes

Thank you for the correction and clarification, @zarf. “Accurate” seems more applicable than “fussy” in this case!