Changeset 08e75215
- Timestamp:
- Mar 26, 2021, 3:02:35 PM (3 years ago)
- 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
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
doc/theses/andrew_beach_MMath/features.tex
rbd0bdd37 r08e75215 147 147 as a hidden field. 148 148 149 \todo{Open/Closed types and how that affects the virtual design.} 149 Up until this point the virtual system is a lot like ones found in object- 150 orientated languages but this where they diverge. Objects encapsulate a 151 single set of behaviours in each type, universally across the entire program, 152 and indeed all programs that use that type definition. In this sense the 153 types are ``closed" and cannot be altered. 154 155 However in \CFA types do not encapsulate any behaviour. Traits are local and 156 types can begin to statify a trait, stop satifying a trait or satify the same 157 trait 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 159 a single set of functions that repersent the type. 160 161 So we don't try to have a single value. The user can define virtual tables 162 which are filled in at their declaration and given a name. Anywhere you can 163 see that name you can use that virtual table; even if it is defined locally 164 inside a function, although in that case you must respect its lifetime. 165 166 An object of a virtual type is ``bound" to a virtual table instance which 167 sets the virtual members for that object. The virtual members can be accessed 168 through the object. 150 169 151 170 While much of the virtual infrastructure is created, it is currently only used
Note: See TracChangeset
for help on using the changeset viewer.