Interpreting ZMS 1.1 description of @get_prop for non-existent property

ZMS 1.1’s description of the @get_prop opcode (The Z-Machine Standards Document) says:

get_prop

2OP:17 11 get_prop object property → (result)

Read property from object (resulting in the default value if it had no such declared property). If the property has length 1, the value is only that byte. If it has length 2, the first two bytes of the property are taken as a word value. It is illegal for the opcode to be used if the property has length greater than 2, and the result is unspecified.

Is there consensus on what should happen if the property requested is not legal for the object in question?

I’m specifically asking about the case where the property is valid, but not for that particular object, e.g. an individual property pr that exists for an object A but not for B, where the instruction is @get_prop B pr -> result.

In this case, there does not seem to be a legitimate “default value” to return.

1 Like

The Z-machine does not have individual properties. That’s an artifice of the Inform veneer. @get_prop only applies to Z-machine properties, which always have defaults in the defaults table.

3 Likes

Thank you once again, @zarf.

(It doesn’t seem to be possible to mark answers as solutions in this category?)