Changeset fbfd97bd for doc/proposals
- Timestamp:
- May 11, 2020, 12:35:36 PM (4 years ago)
- Branches:
- ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
- Children:
- a7b486b
- Parents:
- 0e7e3c17
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
doc/proposals/vtable.md
r0e7e3c17 rfbfd97bd 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 Access 241 This requires that the resolution scope (see below) is at the type level or 242 has explicate points with names. These are the tables and table names used 243 here. 244 245 The system already knows where to find the virtual table and the object. If 246 the tables have particular identities, or on the user side names, then it is 247 meaningful to check if a binding virtual table is the same* as another. The 248 main use of this is virtual table declarations also give the type they bind 249 and if a binding table matches a known table then the underlyind object in the 250 trait object must be of that type. 251 252 * By identity, by value would work and in some senses be more flexiable. But 253 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 virtual 256 tables (see below); the ability to recover the underlying object. Or a pointer 257 of the approprate type it which both reflects the implementation and gives a 258 convenent way to encode the boolean/conditional aspect of the operation which 259 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. The 262 cast is traditional and would definitely fit if a single pointer repersents 263 a trait object with the virtual table as part of the object. However for a 264 double pointer field access might be more approprate. By this system though 265 it is not the type that is used as the identifier but the virtual table. If 266 there is one table per type than it becomes equivilant again. Otherwise the 267 table has to be used as the identifier and the type is just a result of that 268 which seems important for syntax. 239 269 240 270 Hierarchy … … 560 590 be used in only some of the declarations. 561 591 562 trait combiner fee = (summation_instance, sum);592 trait combiner fee = {summation_instance, sum}; 563 593 trait combiner foe = summation_instance; 564 594
Note: See TracChangeset
for help on using the changeset viewer.