F05) Why can't I have virtual declarations/bindings in attributes-fragments?
Description
This article is from the FAQ, by with numerous contributions by
others.
F05) Why can't I have virtual declarations/bindings in attributes-fragments?
There are two problems in allowing virtual declarations in attribute
fragments.
The first problem is a logical problem. Consider:
fSource.bet:
ORIGIN '...'
--- lib: attributes ---
A: (# V:< T;
...
#);
B: A(# <<Blib: attributes>>
...
#);
C: B(# V::< T1;
...
#)
fUsage.bet:
ORIGIN 'fSource'
--- Blib: attributes ---
V::< T2
The problem is, that when doing the semantic checking of V::< T1 in C, it is
impossible to know the further binding in the fUsage.bet fragment, since it
may be compiled after the compilation of the fSource.bet fragment. Thus it
is impossible to ensure, that the further binding in C is in fact legal (to
be legal, T1 must be a subpattern of T and all further bindings that might
appear in all fragments later bound to the Blib slot.
The second problem is in calculating the size of the virtual dispatch table,
if declaration of new virtuals were allowed in fragments bound to the Blib
slot.
 
Continue to: