Ignore:
Timestamp:
Aug 12, 2021, 8:46:58 AM (3 years ago)
Author:
Peter A. Buhr <pabuhr@…>
Branches:
ADT, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast-unique-expr, pthread-emulation, qualifiedEnum
Children:
c9f9d4f
Parents:
bfd7b30
Message:

fix problem in virtual type examples and figure

File:
1 edited

Legend:

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

    rbfd7b30 r93d0ed3  
    165165% The root type has no ancestors.
    166166% A type's descendants are its children and its children's descendants.
    167 Every virtual type also has a pointer to a virtual table with list of virtual members. Children inherit
    168 their parent's list of virtual members but may add new members to it.
    169 For example,
     167Every virtual type (tree node) has a pointer to a virtual table with a unique
     168@Id@ and a list of virtual members (see \autoref{s:VirtualSystem} for
     169details). Children inherit their parent's list of virtual members but may add
     170and/or replace members.  For example,
    170171\begin{cfa}
    171172vtable W0 | { int ?<?( int, int ); int ?+?( int, int ); }
    172 vtable W1 | { int w, int ?==?( int, int ); int ?-?( int, int ); }
     173vtable W1 | { int ?+?( int, int ); int w, int ?-?( int, int ); }
    173174\end{cfa}
    174175creates a virtual table for @W0@ initialized with the matching @<@ and @+@
    175 operations visible at this declaration.  Similarly, @W1@ is initialized with
    176 @<@ and @+@ from the inheritance with @W0@, plus the @==@ and @-@ operations
    177 visible at this declaration. It is important to note that these are virtual
    178 members, not virtual methods of object-orientated programming, and can be of
    179 any type.
     176operations visible at this declaration context.  Similarly, @W1@ is initialized
     177with @<@ from inheritance with @W0@, @+@ is replaced, and @-@ is added, where
     178both operations are matched at this declaration context. It is important to
     179note that these are virtual members, not virtual methods of object-orientated
     180programming, and can be of any type. Finally, trait names can be used to
     181specify the list of virtual members.
    180182
    181183\PAB{Need to look at these when done.
     
    187189as if it were a method.
    188190\todo{Clarify (with an example) virtual methods.}
    189 
    190 Each virtual type has a unique id.
    191 This id and all the virtual members are combined
    192 into a virtual table type. Each virtual type has a pointer to a virtual table
    193 as a hidden field.
    194 \todo{Might need a diagram for virtual structure.}
    195191}%
    196192
Note: See TracChangeset for help on using the changeset viewer.