Next: Record Type Predicates, Up: Record Polymorphism [Contents]
When considering compatibility, we introduce a potential point of failure during header creation; but the record header functions are primitive operations that, in order to simplify the system, should ideally guarantee success. R:make-record-header#3 will silently upgrade the slot count as necessary to ensure record compatibility; it is up to the caller to perform necessary validations and decide whether to fail.
xmlns:R="http://mikegerwitz.com/hoxsl/record"
Determine whether record Sub is compatible with a supertype Supet.
Definition:
<function name="R:is-compatible" as="xs:boolean"> <param name="Sub" as="element( R:Record )" /> <param name="Super" as="element( R:Record )" /> <sequence select="R:slot-count( $Sub ) >= R:slot-count( $Super )" /> </function>