I was looking through the release notes for Standard Library 6/11, and I wanted to try out the before_implici
t property.
Object grapes "grapes" Start
with name 'grapes',
description
"They have before_implicit 3.",
before_implicit 3
has edible pluralname;
Using Inform 6.34/Standard Library 6.12.4, when trying eat the grapes while not holding them, the response is:
>EAT GRAPES
[** Programming error: tried to find the "parent" of nothing **]
[** Programming error: tried to test "has" or "hasnt" of nothing. **]
You aren't holding that.
which, in addition to generating RTEs, apparently ignores the pluralname property set for the grapes
object. The same occurs using Inform 6.35.
Using Inform 6.31/Standard Library 6/11, the RTEs don’t occur, and the message is slightly different:
>EAT GRAPES
You aren't holding that!
Is there something wrong with the definition of the grapes
object?
I looked at the code in parser.h
(StdLib 6.12.4), and, with respect to the disregard for the pluralname
attribute, I think the relevant block (a bit after .GiveError
) is:
if (etype == NOTHELD_PE) {
if (parent(noun) has container)
L__M(##Take, 14, noun);
else
L__M(##Miscellany, 32, not_holding);
oops_from=saved_oops;
}
In english.h
, the LanguageLM()
routine’s Miscellany:
block contains:
32: CSubjectIsnt(actor); " holding that.";
Should this be:
32: CSubjectIsnt(actor); " holding ", (ThatOrThose) x1, ".";
instead?
With “messages” on, the RTEs seem to be being generated during a call to LibraryExtensions.RunWhile()
, but I haven’t figured out exactly what’s going on.
EDIT: It’s not LibraryExtenstions.RunWhile()
, after all. (That’s just the last message passed before the RTEs.) Both RTEs are being generated by the same block, when testing condition (parent(noun) has container)
.
A modification to check for noun being nothing fixes it. (FYI, @DavidG)
if (etype == NOTHELD_PE) {
if (noun ~= nothing && parent(noun) has container) ! THIS LINE MODIFIED
L__M(##Take, 14, noun);
else
L__M(##Miscellany, 32, not_holding);
oops_from=saved_oops;
}