Here’s the source code that tripped me up today.
Room 1 is a room.
Color is a kind of value. The color are red and blue.
A cube is a kind of thing. A cube has a color. The color of a cube is usually red. Understand “” as a cube. Understand “box” as a cube.
This is the report produced by Inform 7 (build 6F95) on its most recent run through:
Problem. You wrote ‘Understand “box” as a cube’ : but grammar tokens must have the same outcome whatever the way they are reached, so writing a line like 'Understand “within” or “next to [something]” as “[my token]” must be wrong: one way it produces a thing, the other way it doesn’t.
See the manual: 16.13 > New tokens
I found this error message pretty confusing and banged my head on the wall for some time. If I took out either Understand statement, it compiled just fine, but it kicked me back out if I had both of them. Eventually, I found my problem:
Understand “” as a cube.
should have been
Understand the color property as describing a cube.
My question is: was the error message appropriate to this circumstance? I’m perfectly happy filing a bug report if this was a bug, but I feel like it might just be my failure to understand the error message, and I wanted to loop through for other people’s thoughts before proceeding.