Hmmm. I see your point, and I agree that it’s not the compiler’s job to determine whether your code is doing what you think it should be doing. However, this feels different to me for reasons I’m having trouble pinning down precisely. Maybe this: The code generated is obviously “valid” when considered as I6, but the translation to I6 doesn’t seem valid to me.
I rooted through the documentation (general index), and I found WWI 6.11 and WWI 7.11 as the applicable sections; if you’re thinking of others, please let me know. (I see that zarf already mentioned 7.11.)
WWI 6.11 A word about in makes an effort to differentiate between containment
and enclosure
, and between containment
and regional-containment
(even though it avoids mentioning the relations explicitly this early in the text). That discussion applies only to <thing> is in <thing>
, <thing> is in <room>
or <thing> is in <region>
constructions.
If I’m not misunderstanding, the construction
After waiting while the player is in Limbo:
[I6 translation: ((((action ==##Wait) && (actor==player) && (self=actor,true) && (((I126_limbo == ContainerOf(player)))))))]
is handled partly as an action pattern (waiting
) and partly as a condition (the player is in Limbo
).
WWI 7.11 In rooms and regions discusses the in <room>
and in <region>
constructions. It does not have any examples indicating that in <thing>
is a valid pattern, but neither does it have any note warning that such a construction can’t possibly work correctly, nor does it explain how the underlying I6 comparison is generated so that it’s more obvious that using it that way is incorrect.
Again, if I’m not misunderstanding, the construction
After waiting in Limbo:
[I6 translation: ((((action ==##Wait) && (actor==player) && ((real_location == I126_limbo) && (true)))))]
is handled as a single action pattern (waiting in Limbo
).
Although now deprecated and therefore not mentioned outside of the vestigial note in WorldModel.i6t
, with the pre-6L02 phrase to decide whether in (O - object)
in place the compiler would also understand
After waiting while in Limbo:
[I6 translation: ((((action ==##Wait) && (actor==player) && (self=actor,true) && (((WhetherIn(I126_limbo)))))))]
which would again be handled as partly an action pattern (waiting
) and partly a condition (in Limbo
).
I share Zed’s stance that the ability to detect semantic problems is of value. And, in fact, the I7 compiler does this all the time for phrases set up by the Standard Rules and your own code. I’m assuming that in this case it’s because the compiler is working at a lower level than phrases (and because it wants to be able to accept in <description of objects>
) that it’s even allowing an action pattern like waiting in west
. Still
, right now it’s somehow noticing the usage <action> in <region>
and responding in a type-appropriate way (vs. the apparent default of a comparison to real_location
), so it certainly seems to me that it should do the something appropriate for <action> in <thing>
for the sake of consistency.
I think that the way WWI 6.11 examples cover regions, rooms and things while the WWI 7.11 examples cover regions and rooms (but not things) creates a contrast that highlights what I perceive as a significant gap in functionality. It’s because it’s an inconsistency in the range of acceptable parameters between two highly similar (if different) sets of patterns – and because that gap results in what I think of as a significant translation error, where translation is the core function of a compiler – that I think of that gap as a bug. If the compiler were currently rejecting After waiting in the box:
then I would unhesitatingly agree that it would be a feature request to want it to produce meaningful I6 instead.
That said, I think I better understand the reasons for the current behavior now, and I definitely better understand some subtleties of how the compiler sees rule preambles, so thank you very much for the discussion.