MantisBT - Core Inform
View Issue Details
0000869Core InformModel worldpublic2012-02-24 19:542014-05-07 07:33
(serious/mild) Game compiles but misbehaves
0000869: Examining includes a spurious "the" if "to say the" is overridden
1. Provide a "to say the (p - sayable value)" that provides some additional text.
  Ex. To say the (p - sayable value): say "<[p]>".
2. Ensure there is something with a description.
  Ex. Coin is a thing. The description of the coin is "This is a coin."
3. Proceed into game.
4. Examine something with a description.
  Ex. x coin

The extra text in "the" is added to the description.
  Ex. <This is a coin.>

No extra text added to the description.
  Ex. This is a coin.
"Bad The" by Kateye

To say the (p - sayable value): say "<[p]>".

Coin is a thing. The description of the coin is "This is a coin."

Test is a room. A coin is in test.

Test me with "x coin".
Work around:

Carry out examining something: instead say "[description of item described]".
No tags attached.
Issue History
2012-02-24 19:54ErzengelNew Issue
2012-02-24 19:57ErzengelIssue Monitored: Erzengel
2012-02-24 22:31ErzengelNote Added: 0001590
2012-02-24 22:49ErzengelNote Edited: 0001590bug_revision_view_page.php?bugnote_id=0001590#r644
2012-02-24 22:49ErzengelNote Edited: 0001590bug_revision_view_page.php?bugnote_id=0001590#r645
2012-02-25 10:02mattweinerNote Added: 0001591
2012-02-27 10:23EmacsUserNote Added: 0001594
2012-02-27 10:23EmacsUserAssigned To => EmacsUser
2012-02-27 10:23EmacsUserStatusnew => feedback
2012-02-27 10:41mattweinerNote Added: 0001595
2012-02-27 11:32EmacsUserNote Added: 0001596
2012-03-31 20:43jmcgrewNote Added: 0001635
2012-04-02 11:56EmacsUserNote Added: 0001638
2012-04-02 11:56EmacsUserAssigned ToEmacsUser =>
2012-04-02 11:56EmacsUserReproducibilityhave not tried => always
2012-04-02 11:56EmacsUserStatusfeedback => confirmed
2014-02-13 11:30grahamNote Added: 0002484
2014-02-13 11:30grahamStatusconfirmed => resolved
2014-02-13 11:30grahamResolutionopen => fixed
2014-02-13 11:30grahamAssigned To => graham
2014-05-07 07:32jmcgrewFixed in Version => 6L02
2014-05-07 07:33jmcgrewStatusresolved => closed

2012-02-24 22:31   
(edited on: 2012-02-24 22:49)
A better work around:

The fixed standard examining rule is listed instead of the standard examining rule in the carry out examining rules.
Carry out examining (this is the fixed standard examining rule):
if the noun provides the property description and the description of the noun is not "":
say "[description of the noun][line break]";
now examine text printed is true.

2012-02-25 10:02   
Forum thread: [^]

See another proposed workaround here: [^]
2012-02-27 10:23   
I'm reluctant to call this an Inform bug. The compiler is certainly behaving as instructed, because the new say phrase is written to apply to all sayable values, which just turned out to be more than the author intended. And while the Standard Rules could be rewritten to avoid articles in all text substitutions, this would only reduce their legibility without eliminating the problem (many other extensions use the same coding pattern).

Felix's suggestion, I think, gets at the crux of the matter. Because the intent is to create new say phrases for custom kinds of values, the scope of the phrases should be pruned down to just those kinds. For instance, you might consider writing ``enumerated value'' in place of ``sayable value.''
2012-02-27 10:41   
Well, the issue is not so much that the rule applies to more sayable values than intended, it's that the Standard Rules include tokens like "[the description of the item described]" when no article is supposed to be intended. This means that "the" isn't always handled the same way in text substitutions, which in turn means that something that handles "the" uniformly in text substitutions yields inconsistent results.

This may well be a feature suggestion rather than a bug, though perhaps it would be a good idea to document the difference between "[the description of the item described]" and "[the list of things contained by the item described]". Anyway, the "enumerated value" fix should work OK for anything I'd need to do with this anytime soon. I suppose that if I run into more problems here I can post it on Uservoice.
2012-02-27 11:32   
Hmm, yes, I see your point that articles are inferred from the form of the substitution sometimes but not always, and that the Standard Rules depend on that behavior. Currently, the line between articles in substitutions mattering or not is drawn along kind boundaries, hence my comment. But if the line ought to be elsewhere or ought not exist, then we do have a bug. That's not something I know, nor is it my call to make, so I'll ask. (Even if the distinction is supposed to be where it is, we might have a documentation bug, as you point out.)
2012-03-31 20:43   
Inform ignores "the" before an expression to allow more literate code, and also ignores it in a regular phrase definition, but not in a to-say phrase definition. So "[the X]" is parsed differently depending on whether "to say the (something matching X)" has been defined. Currently it's defined for objects and special case phrases ("[the list of...]" vs. "[list of...]"), but since it can be defined at any time for other kinds of value, every substitution with an ignored article has the potential to break.

I suggest removing the optional "the" from all substitutions in the Standard Rules, clarifying the manual to explain that articles are *always* significant in substitutions, and adding standard "the"/"a" phrases for sayable values. This will be a breaking change, but updating old code should be as easy as searching for "[the" and removing the article wherever you don't want to print it.
2012-04-02 11:56   
Then I'll confirm it.
2014-02-13 11:30   
Well, I've made two changes to the Standard Rules (one of them indeed the standard examining rule), but to be honest I don't consider this a bug.