Changes in doc/proposals/vtable.md [fbfd97bd:0f740d6]
- File:
-
- 1 edited
-
doc/proposals/vtable.md (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
doc/proposals/vtable.md
rfbfd97bd r0f740d6 237 237 default is provided or not, the second syntax can be used to pick a 238 238 parameter on instantiation. 239 240 ### Extension: Object Access241 This requires that the resolution scope (see below) is at the type level or242 has explicate points with names. These are the tables and table names used243 here.244 245 The system already knows where to find the virtual table and the object. If246 the tables have particular identities, or on the user side names, then it is247 meaningful to check if a binding virtual table is the same* as another. The248 main use of this is virtual table declarations also give the type they bind249 and if a binding table matches a known table then the underlyind object in the250 trait object must be of that type.251 252 * By identity, by value would work and in some senses be more flexiable. But253 it would be slower and refering to further away functions would be harder.254 255 This gives one of the main new features of the hierarchical use of virtual256 tables (see below); the ability to recover the underlying object. Or a pointer257 of the approprate type it which both reflects the implementation and gives a258 convenent way to encode the boolean/conditional aspect of the operation which259 is that a different virtual table might be in use.260 261 There are two general ways to reperent this; a cast or a field access. The262 cast is traditional and would definitely fit if a single pointer repersents263 a trait object with the virtual table as part of the object. However for a264 double pointer field access might be more approprate. By this system though265 it is not the type that is used as the identifier but the virtual table. If266 there is one table per type than it becomes equivilant again. Otherwise the267 table has to be used as the identifier and the type is just a result of that268 which seems important for syntax.269 239 270 240 Hierarchy … … 590 560 be used in only some of the declarations. 591 561 592 trait combiner fee = {summation_instance, sum};562 trait combiner fee = (summation_instance, sum); 593 563 trait combiner foe = summation_instance; 594 564
Note:
See TracChangeset
for help on using the changeset viewer.