Re: Inform: capitalising indefinitely


27 Aug 95 22:56:14

jools@arnod.demon.co.uk (Julian Arnold) wrote:

> With Inform 5.5 I can use the new printing syntax (`print (the) expression',
> and so on). This is great and makes reading my source a far more tolerable
> experience. But, although I can use `print (the)' and `print (The)' for
> lower case and capitalised definite articles I can't have the equivalent for
> indefinite articles (ie `print (a)' works but there is no `print (A)').

[snip]

> Is there, then, a way to capitalise indefinite articles?

At the risk of putting my foot in my mouth, I'd say there isn't. If I
understand things correctly, `print_ret (a) self, " is parked here.";'
is merely shorthand for `Indefart(self); print_ret " is parked here.";'.
Indefart() is defined in the library as

[ Indefart o;
if (o hasnt proper) { PrintOrRun(o,article,1); print " "; }
PrintShortName(o);
];

This means that a generic `print (A)' would have to deal with the
problem that `article' could either be a string or a routine. The
Defart() and CDefart() functions called by `print (the)' and
`print (The)' respectively have a much simpler task, since the
definite article, if any, is always "the".

I'm not sure whether or not it'd be possible to write a CIndefart()
function that worked even making the assumption that `article' is
always a string. I have a nagging feeling that if it was, the library
would provide a function for it already, but I could very well be
wrong.

What I'm pretty sure you *could* do is to define a function - you
could maybe even call it A(), if you wanted `print (A)' to be the
syntax, as the compiler seems to be case-sensitive enough at this
stage not to confuse it with `print (a)' - which works like
Indefart(), but uses another property than `article', and then have
your objects define this second property, or write the `article'
property in your objects as a routine which prints different strings
depending on a global variable set by A().

In any case, it seems to me like more work than it would be worth for
such a small result.

_
Torbjorn Andersson