First rule... is different from ...rule is listed first...

Consider this:

[code]After reading a command (this is the first in source rule):
say “This should have been preempted.”

The first in source rule is listed first in the after reading a command rules.

Test is a room.

First after reading a command (this is the not really first rule):
say “This was supposed to be first.”

test me with “rules/z”[/code]

There’s an “after reading a command” rule which is “…listed first” in the extension., which gets ordered before the “first…” rule in the source. If I say “the not really first rule is listed first in the after reading a command rules,” it goes where you’d expect, but I thought these two syntaxes were synonymous.

Plus, the “rules” reporting never even tells me that the not really first rule is running. I tried this example with an extension, and the ARaC rule in the extension DID get reported. Why is that?

1 Like

Obviously, I don’t know the answer, but perhaps they are parsed at different times. If the compiler first orders rules after their preambles (putting a first rule first and a last one last and the others in order of specificity), and only after that works through what rules are explicitly listed first or last, before or after each other etc. (thus moving the rule explicitly listed first first etc.), then this is the result you’d get, right?

That makes perfect sense. Except that I never would have thought of it. Ugh.

What’s not intuitive is that it seems rule ordering is done in two passes. First, the rules are created in the order that their preambles state. Then the rules are reorganized according to the “…listed…” directives. If they were both done in a single pass, I think the ordering would have ended up the way I expected.