Changeset 08e75215


Ignore:
Timestamp:
Mar 26, 2021, 3:02:35 PM (3 years ago)
Author:
Andrew Beach <ajbeach@…>
Branches:
ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast-unique-expr, pthread-emulation, qualifiedEnum
Children:
f8a7fed
Parents:
bd0bdd37
Message:

Andrew MMath: Expanded a todo about open/closed types.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • doc/theses/andrew_beach_MMath/features.tex

    rbd0bdd37 r08e75215  
    147147as a hidden field.
    148148
    149 \todo{Open/Closed types and how that affects the virtual design.}
     149Up until this point the virtual system is a lot like ones found in object-
     150orientated languages but this where they diverge. Objects encapsulate a
     151single set of behaviours in each type, universally across the entire program,
     152and indeed all programs that use that type definition. In this sense the
     153types are ``closed" and cannot be altered.
     154
     155However in \CFA types do not encapsulate any behaviour. Traits are local and
     156types can begin to statify a trait, stop satifying a trait or satify the same
     157trait in a different way with each new definition. In this sense they are
     158``open" as they can change at any time. This means it is implossible to pick
     159a single set of functions that repersent the type.
     160
     161So we don't try to have a single value. The user can define virtual tables
     162which are filled in at their declaration and given a name. Anywhere you can
     163see that name you can use that virtual table; even if it is defined locally
     164inside a function, although in that case you must respect its lifetime.
     165
     166An object of a virtual type is ``bound" to a virtual table instance which
     167sets the virtual members for that object. The virtual members can be accessed
     168through the object.
    150169
    151170While much of the virtual infrastructure is created, it is currently only used
Note: See TracChangeset for help on using the changeset viewer.