Changes in / [3bd5ca7:f8a7fed]

1 edited


  • doc/theses/andrew_beach_MMath/features.tex

    r3bd5ca7 rf8a7fed  
    147147as a hidden field.
    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.
     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.
     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.
     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.
    151170While much of the virtual infrastructure is created, it is currently only used
Note: See TracChangeset for help on using the changeset viewer.