On 2025-08-28 10:50, Kevin Chadwick wrote:
I can explain how it works. When a DLL is loaded its library level
gets elaborated. So if you have:
package P is
type T is tagged ...
end P;
in the main program or DLL and
with P;
package Q is
type S is new T with ...
function F return T'Class;
end Q;
in the DLL being loaded, then in the process of elaboration S will be
created which in particular means extending of the dispatching table.
You can return a class-wide object from there and dispatch on the
newly created type's operation.
Clear?
Interesting, better than the shape examples but I guess you have to get
that in the first instance.
Dynamic polymorphism is an extremely powerful mechanism, but it kind of
bends out of traditional typing.
It is like the relativity theory. Everything is relative, position,
velocity, but up to the point. Acceleration is not anymore. Same is with >typing: value->type, so far so good, but one more step up:
value->type->class and something happens. Primitive operations become >reachable even if you do not see them, you cannot hide them. Multiple >inheritance, OK, but what about conflicts, is it additive or idempotent? >Multiple dispatch is a total dark hole.
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 546 |
Nodes: | 16 (0 / 16) |
Uptime: | 163:58:27 |
Calls: | 10,385 |
Calls today: | 2 |
Files: | 14,057 |
Messages: | 6,416,513 |