chickadee » srfi-137 » make-type

make-type type-payloadprocedure

Calling make-type on type-payload, which can be any Scheme object, returns five values, all of which are procedures. They are distinct (in the sense of eqv?) from each other and from any other procedures returned by other calls to make-type. In brief, the five functions respectively:

  • return type-payload
  • return newly allocated objects of a disjoint type known as instances, each associated with an instance payload
  • return #t iff an object is an instance of this type
  • return the instance payload
  • return five more procedures associated with a subtype of this type

Details are given for a sample type in the next section. The type payload might contain metadata (such as field names or class variables) associated with the type as a whole.