I7: problems with rulebook variable and multiple object list

The following code fails to compile, but I’m not sure why:

[spoiler][code]Section 1 - Acting on Groups and Stuff

Multiple actions already taken is a truth state that varies. Multiple actions already checked is a truth state that varies.

Every turn:
now multiple actions already taken is false;
now multiple actions already checked is false.

Action on groups is an action-name based rulebook. Action on groups has default failure. The action on groups rulebook has a list of things called group acted on.

First action on groups rule (this is the set the group rule):
now the group acted on is the multiple object list;
make no decision.

An action-processing rule when the current action is groupable action and the multiple object list is not empty and multiple actions already checked is false (this is the check for group action rule):
now multiple actions already checked is true;
follow the action on groups rules for the action name part of the current action;
if rule succeeded or rule failed:
now multiple actions already taken is true.

The check for group action rule is listed before the announce items from multiple object lists rule in the action-processing rulebook. [Could list it “first” but I want to leave open the possibility of another extension putting another rule first–all we need is to guarantee that it winds up before the announce items rule.]

The announce items from multiple object lists rule does nothing when multiple actions already taken is true.

To decide whether (list one - a list of things) is the same list as (list two - a list of things):
repeat with tester running through list one:
if tester is not listed in list two:
no;
repeat with tester running through list two:
if tester is not listed in list one:
no;
yes.

Section 2 - Some Other Code from “The Left Hand of Autumn”

[with a whole lot of stuff to handle multiple examining snipped]

After reading a command:
repeat through the Table of Collective Names:
let N be “[the player’s command]”;
let Y be relevant list entry;
while N matches the regular expression “[name-text entry]”:
replace the regular expression “(.*)name-text entry” in N with “\1[Y]\2”;
change the text of the player’s command to N.

Report taking something:
say “You pick up [the noun].” instead.

[and this next bit is commented out because it’d be too much work at the moment]

[And as a bit of polish, because we’d like SEARCH TABLE to have the same effect as EXAMINE ALL ON TABLE:]

[Understand “look on [something]” as searching.

Instead of searching something which supports at least two things:
let L be the list of things supported by the noun;
describe L.
Instead of searching something which contains at least two things:
let L be the list of things contained by the noun;
describe L.]

Section 3 - Scenario

Eight-Walled Chamber is a room. “A perfectly octagonal room whose walls are tinted in various hues.”

The display table is a supporter in the Chamber. A twig of rowan wood is on the table.

The player carries an apple and a pear.

A glove is a kind of thing. A glove is always wearable. Understand “glove” as a glove. The player carries a left glove and a right glove. The left glove and the right glove are gloves.

[Now we define a few actual lists of items:]

Fruit list is a list of things which varies. Fruit list is { apple, pear }.
Glove list is a list of things which varies. Glove list is { right glove, left glove }.
Arcane list is a list of things which varies. Arcane list is { left glove, twig, pear }.

[The following code is commented out because it is superseded by the new group action stuff.]

[To describe (L - a list of objects):
sort L;
if L is fruit list:
say “Just a couple of fruits.”;
otherwise if L is glove list:
say “It’s a matched pair of fuzzy blue gloves.”;
otherwise if L is arcane list:
say “To anyone else it might look like a random collection of objects, but these three things – [L with definite articles] – constitute a mystic key known as the Left Hand of Autumn. They practically hum with power.”;
otherwise:
say “You see [L with indefinite articles].”

When play begins:
sort fruit list;
sort glove list;
sort the arcane list.]

[We sort the lists so that regardless of how we change the rest of the code (and the order in which objects are coded), the resulting list will always be in sorted order and ready to compare with the list of items the player wants to look at. And thanks to the “Reading a command” code we wrote earlier, we can also teach the game to understand the player’s references to “the left hand of autumn” as a specific collection of items.]

Table of Collective Names
name-text relevant list
“left hand of autumn” “[arcane list]”
“gloves” “[glove list]”
“pair of gloves” “[glove list]”

Test me with “x apple and pear / x left and right / put pear on table / put left glove on table / x all on table / put all on table / examine all on table / get apple, twig, pear / x all on table / search table”.

Section 4 - Handling the Scenario with Action on Groups

Examining is groupable action. Understand “examine [things]” as examining.

An action on groups rule for examining when the fruit list is the same list as the group acted on:
say “Just a couple of fruits.”

An action on groups rule for examining when the group acted on is the same list as the glove list:
say “It’s a matched pair of fuzzy blue gloves.”

An action on groups rule for examining when the group acted on is the same list as arcane list:
say “To anyone else it might look like a random collection of objects, but these three things – [group acted on with definite articles] – constitute a mystic key known as the Left Hand of Autumn. They practically hum with power.”

Last action on groups rule for examining:
say “You see [group acted on with indefinite articles].”[/code][/spoiler]

The rule headings such as “An action on groups rule for examining when the fruit list is the same list as the group acted on:” all failed because the compiler didn’t recognize “group acted on.” Why not? As a rulebook variable for the rulebook, it doesn’t seem like it should create a problem. (I tried other names and they didn’t work either.)

Results of translation:

When I tried eliminating the rulebook variable and compared things directly to the multiple object list I got an abject failure. My current solution is to write the “is the same list as” phrase so it’s hardcoded to use the multiple object list as one of the things to compare, but I’d like to know what I’m doing wrong.