I’m not able to instantiate a thing in a location within a single sentence. Ex from “§17.8. Understanding names:” The St Bernard is an animal in the Monastery Cages.
gives me the error
Problem. The sentence ‘The St Bernard is an animal in the Monastery Cages’ appears to say two things are the same - I am reading ‘St Bernard’ and ‘animal in the Monastery Cages’ as two different things, and therefore it makes no sense to say that one is the other…
I can easily work around this by saying The St Bernard is an animal. It is in the Monastery Cages.
Why, though, does this structure appear throughout the documentation if it doesn’t work?
Yeah if the compiler doesn’t know that that’s the name of a room, it gets confused - “in” isn’t enough by itself to indicate that’s a room (which makes sense - could be a container, could be part of a name like jack in the box, etc)
It could be, that’s why you have to declare it in source first. Like Mike says, if the compiler sees something like in the crate without having been told about the crate first, it can’t tell whether you’re referring to a room, a container, a region, or something which just has the word “in” somewhere in its name. In this case it prefers not to guess. The error message isn’t the most helpful, but that’s more the ambiguity of natural languages than the fault of the compiler.
The St Bernard is an animal. It is in the Monastery Cages.
without declaring the Monastery Cages, the compiler is fine with it. To my non-computer brain, these two sentences have the same lack of specificity as the single-sentence version. I’m not seeing how the compiler is okay with guessing in one version and not okay in t’other.
The St Bernard is an animal. It is in the Monastery Cages.
This provides at least one hint to the compiler: that “an animal” and “a thing in the Cages” are two separate qualifiers. The one-sentence form leaves open the possibility that “an animal in the Cages” is a single term (perhaps an overly complicated kind or object name).
I don’t know much about the I7 compiler and how it resolves possible interpretations. But the two forms aren’t identical.
It makes a weird sort of sense to me that the compiler is okay with guessing that “the Monastery Cages” is a room but that “animal in the Monastery Cages” might or might not be a special kind of animal. I will probably just keep initializing stuff in two steps just so I don’t have to worry about it.