--- layout: default title: "Objects" parent: Composite ancestor: Funcons-beta --- [Funcons-beta] : [Objects.cbs] ----------------------------- ### 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 Env with the features of the object, and * a sequence O* of subobjects of the direct superclasses of C. 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*) ~> A
Funcon
  object-class-name(_:objects) : =>identifiers
Rule
  object-class-name
    object(_:atoms, C:identifiers, _:environments, _*:objects*) ~> C
Funcon
  object-feature-map(_:objects) : =>environments
Rule
  object-feature-map
    object(_:atoms, _:identifiers, Env:environments, _*:objects*) ~> Env
Funcon
  object-subobject-sequence(_:objects) : =>objects*
Rule
  object-subobject-sequence
    object(_:atoms, _:identifiers, _:environments, O*:objects*) ~> O*
Funcon
  object-tree(_:objects) : =>trees(objects)
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. ____ From the [PLanCompS Project] | [CBS-beta issues...] | [Suggest an improvement...] [Objects.cbs]: Objects.cbs "CBS SOURCE FILE" [Funcons-beta]: /CBS-beta/docs/Funcons-beta "FUNCONS-BETA" [Unstable-Funcons-beta]: /CBS-beta/docs/Unstable-Funcons-beta "UNSTABLE-FUNCONS-BETA" [Languages-beta]: /CBS-beta/docs/Languages-beta "LANGUAGES-BETA" [Unstable-Languages-beta]: /CBS-beta/docs/Unstable-Languages-beta "UNSTABLE-LANGUAGES-BETA" [CBS-beta]: /CBS-beta "CBS-BETA" [PLanCompS Project]: https://plancomps.github.io "PROGRAMMING LANGUAGE COMPONENTS AND SPECIFICATIONS PROJECT HOME PAGE" [CBS-beta issues...]: https://github.com/plancomps/CBS-beta/issues "CBS-BETA ISSUE REPORTS ON GITHUB" [Suggest an improvement...]: mailto:plancomps@gmail.com?Subject=CBS-beta%20-%20comment&Body=Re%3A%20CBS-beta%20specification%20at%20Values/Composite/Objects/Objects.cbs%0A%0AComment/Query/Issue/Suggestion%3A%0A%0A%0ASignature%3A%0A "GENERATE AN EMAIL TEMPLATE"