As a KISS alternative, one could just include an equivalent of GetEitherOrProperty() into a 10.1 project to make your original code work…
However, in 10.1 that functionality seems to be superseded by the following function:
[ _final_propertyvalue K o p t;
if (K == OBJECT_TY) { !### properties/attributes for objects
if (metaclass(o) == Object) {
t = p-->0; p = p-->1; !### get property/attribute type ID and move p to pointer to property
if (t == 2) { if (o has p) rtrue; rfalse; } !### type ID of 2 == attribute: return attribute value
if (o provides p) return o.p; !### return property value
}
rfalse; !### invalid object, or object does not provide property requested
} else { !### properties for kinds of values
t = value_property_holders-->K;
return (t.(p-->1))-->(o+COL_HSIZE);
}
];
which returns the value of a I6 property/attribute of an object, or the value of a property of a value-
it is called with K (kind- (OBJECT_TY for objects, or the kind of value for values), o (the object or value), p (a property ID- which in the case of objects is used as an index to look up in an array the property/attribute type ID (with 2 indicating an attribute) together with a pointer to the actual property, then retrieves the attribute/property value as appropriate.
Unfortunately, like the .inf
version of [MoveFloatingObjects;…], this can’t be compiled as an I6 inclusion in source because it seems to depend on structures (like the property type ID/property pointer array) created in the final iteration of inter->I6 conversion and which are not present in the original kit I6.
GetEitherOrProperty(object, property/attribute) depends in 6M62 on a hacky method (that is unavailable in 10.1.2) for deciding whether the second parameter is an attribute or a property, and I don’t know a way of determining in 10.1.2 source whether an I7 boolean property has been compiled as an I6 property or an attribute.
One hacky way round this would be to define a three-way property in I7 (including a redundant null value) rather than a boolean, or to define bucket-status as an (enumerated) value with 2 values buckety and non-buckety then assign rooms a bucket-status property, either of which would guarantee compilation as a property:
"test_Floating_Objects" by PB
bucket-status is a kind of value. The bucket-statuses are non-buckety and buckety. Every room has a bucket-status.
Other Place is east of Place. Other Place is buckety.
Yet Another Place is east of Other Place. Yet Another Place is buckety.
A container called a magical bucket is in Place.
Include (- with found_in [; return (real_location.(+ bucket-status +)) -1; ] -) when defining the magical bucket.
One neat solution is assign the buckety property from a table, which also ensures that even boolean properties are compiled as I6 properties rather than attributes:
"test_Floating_Objects" by PB
Some rooms are defined by the Table of Locations.
Table of Locations
room buckety
Place false
Other Place true
Yet Another Place true
Place is a room.
Other Place is east of Place.
Yet Another Place is east of Other Place.
A container called a magical bucket is in Place.
Include (- with found_in [; return real_location.(+ buckety +); ] -) when defining the magical bucket.
EDIT as long as at least one instance of the property is defined in a table, the property will compile to an I6 property rather than an attribute. Elsewhere in the code property values can be asserted in the usual way, e.g. `The buckety of Other Place is true.’