What rulebook is Rule for supplying a missing second noun in?

I need to replace a rule which is causing a runtime error. It’s a Rule for supplying a missing second noun rule. Which rulebook would I find it in? It’s nowhere to be found in the Actions tab.

For future versions of Inform, it would be great if you could just put:

The new assume matching source rule is listed instead of the assume matching source rule.

without having to specify which rulebook it replaces it in. Inform already knows which rulebook it’s in; I don’t, and I have no way to find out besides asking someone cleverer here.

2 Likes

Supplying a missing second noun is an activity, for which you can write rules. If it’s a runtime error, though, it it because you’ve got code checking something about second nouns when either the grammar involved or the action doesn’t actually use one? That’s how I usually get errors about second nouns. (EDIT: The fix for me has been wrapping code like this in a sanity test: if the second noun is not nothing: )

I think we’ll need to see the text of the runtime error.

Re: this part, I’m not up (down?) with Inform 10’s changes to this kind of thing since 6M62, if any, but a reason in general is that rules can appear in multiple rulebooks. You could ask it to assume one if the rule only appears in one, but some lizard part of myprogrammer’s brain tells me that would be a weird exception. Others may just come in and say, ‘That would be downright weird!’. We’ll see.

-Wade

1 Like

No, it’s a rule in Emily Short’s Measured Liquid extension, and it checks the “liquid” property of the noun before checking that the noun even has a “liquid” property.

This is my brute-force solution:

The assume matching source rule is not listed in any rulebook.

Rule for supplying a missing second noun while an actor filling (this is the new assume matching source rule):
    etc. etc. etc.

Okay, so is it a bug in that extension? Sorry, I’m just checking because you didn’t quote the text of the error.

-Wade

I’ve just imported the extension into a new project and the error doesn’t occur. I’ve made a huge number of changes to the extension and somehow I’ve introduced an error. I think the best thing is that I go through my own code with a fine tooth comb and track down the problem.

Sorry for the desperate tone of my messages, I’m just a bit flustered.

2 Likes

No worries and good luck. Just make sure you don’t toss any babies out with the bathwater :slight_smile:

-Wade

2 Likes

The name of the rulebook is simply the

‘for supplying a missing second noun rulebook’.

Activities have three rulebooks:

the before <the activity> rulebook
the for <the activity> rulebook
the after <the activity> rulebook

See WI §18.3. Rules applied to activities

1 Like

Update: To my enormous relief, there really is a bug in Measured Liquid and it’s not something I’ve done by tinkering with the extension. :face_exhaling:

Thank you Peter for pointing me to the correct rulebook!

4 Likes

We just call that “a solution”. :)

6 Likes

… there’s actually a point to the rulebook specification: rules can be listed in multiple rulebooks and Inform doesn’t want to just assume you mean to replace it in all of them. (But it’s not hard to imagine a different behavior that allowed substitution without specifying a rulebook to just work if the rule’s only in one rulebook, to throw an error if it’s in more than one, and to allow “in any rulebook” if you do mean replace it in any rulebook in which it occurs.)

1 Like

Can’t you accomplish that with “substitutes for”?

1 Like

I wrote that in the final hours of the competition when I desperately trying to track down a bug, and I was not in the best of humours. I take your point, and I do think the behaviour you describe would be preferable. I often find myself wishing there was an easier way to identify which rulebook(s) a rule can be found in.