Deciding scope after multipart functions

This code works properly:

After deciding the scope of the player when taking: repeat with current running through quips carried by sherlock holmes: place current in scope.

But this does not:

After deciding the scope of the player when inserting it into: repeat with current running through quips carried by sherlock holmes: place current in scope.

The specific error message is “You wrote ‘After deciding the scope of the player when inserting it into’ : but I don’t understand the ‘when/while’ clause, which should name activities or conditions.”

What is the correct command name here?

You need “inserting something into”; Inform doesn’t like the “it”.

Learning when a reference to an action requires “it” and when it requires “something” is an endless journey.

And there are a few circumstances where you need to omit both. Such as:

Rule for deciding whether all includes (something) when inserting into:

Mm, all of these work (and behave the same):

Rule for deciding whether all includes the rock when inserting something into:

Rule for deciding whether all includes the rock when inserting into:

Rule for deciding whether all includes the rock when inserting:

It turns out that I had a bunch of ‘before inserting’, ‘instead of inserting’, and ‘carry out inserting’ fragments of code floating around that were interfering with all of this. That’s what you get for using legacy code, adding quick scaffolding to release an intro, and then stacking more content on top of that. This code is a mess!

These suggestions all helped me figure it out. Thanks!

Not so!

Test Suite is a room. The box is here. It is an open container. 
The player carries a rock.

Rule for deciding whether all includes the rock when inserting something into: it does not.

But

Test Suite is a room. The box is here. It is an open container. 
The player carries a rock.

Rule for deciding whether all includes the rock when inserting into: it does not.

The reason for this is (kind of) documented at 17.19.

(I agree that “Inserting” and “inserting into” are interchangeable, as long as we don’t define a separate inserting action.)

Ooh, good catch. I totally missed that. I even looked at the code before posting(*)! The only difference between the cases is an extra “(noun ofclass K2_thing)” test. This follows the I7 phrasing in a natural way: “inserting” or “inserting into” tests whether the action is Inserting. “Inserting something into” tests whether the action is Inserting and the noun is something, e.g., a member of the Thing kind.

But in your test code, at the time the “deciding all” activity runs, noun is not yet set! It’s nothing. So the rule doesn’t fire.

In fact you can write

Rule for deciding whether all includes the rock when inserting nothing into:

…and the rule will fire.

I’m not sure what the lesson is. Watch out for this case, I guess.

(* Honest, I don’t have all of I7 memorized. I look at the code and test examples before posting. Only this time I skipped the testing part, heh.)

There are a few other parser activities where it can come up. (“Does the player mean”, “asking which do you mean”, “deciding the scope”. Maybe some more.)