Funcons-beta : Objects.cbs | PRETTY | PDF
Objects
[
Datatype objects
Funcon object
Funcon object-identity
Funcon object-class-name
Funcon object-feature-map
Funcon object-subobject-sequence
Funcon object-tree
Funcon object-single-inheritance-feature-map
]Datatype
objects ::= object(_:atoms, _:identifiers, _:environments, _:objects*)object( A, C, Env, O*) is an object:
- distinguished by an atom
A, - of a class named
C, - with an environment
Envwith the features of the object, and - a sequence
O*of subobjects of the direct superclasses ofC.object( A, C, Env)is an object of a base class.object( A, C, Env, O′)is an object of a class with a single superclass. With multiple inheritance, subobjects due to repeated inheritance of the same class may be shared.
Implementations of objects generally represent an object as a vector of fields, and use pointers and offsets for efficient access to individual fields. The representation of objects used in this specification is independent of such implementation concerns.
Funcon
object-identity(_:objects) : =>atoms
Rule
object-identity
object(A:atoms, _:identifiers, _:environments, _*:objects*) ~> AFuncon
object-class-name(_:objects) : =>identifiers
Rule
object-class-name
object(_:atoms, C:identifiers, _:environments, _*:objects*) ~> CFuncon
object-feature-map(_:objects) : =>environments
Rule
object-feature-map
object(_:atoms, _:identifiers, Env:environments, _*:objects*) ~> EnvFuncon
object-subobject-sequence(_:objects) : =>objects*
Rule
object-subobject-sequence
object(_:atoms, _:identifiers, _:environments, O*:objects*) ~> O*object-tree O forms a tree where the branches are the object trees for
the direct subobjects of O.
Rule
object-tree(O:objects)
~> tree(O,
interleave-map (
object-tree given,
object-subobject-sequence O))Funcon
object-single-inheritance-feature-map(O:objects) : =>environments
~> map-override left-to-right-map(
object-feature-map given,
single-branching-sequence object-tree O)For multiple inheritance, different resolution orders can be specified by using difference linearisations of the object tree.