|
I used ObjectHeader in the table
because this pseudo-C language supports subtyping. That isn't the
case for your extensible records proposal; your proposal would
need to either store Objects, or invert the ObjectHeader so it's
parameterized over its extension, ie. data ObjectHeader R =
ObjectHeader { id : UInt64 | R }, and then obj_table :: ArrayN (forall
R. ObjectHeader R) Size.
My original sample code didn't provide for projection of a class type to an underlying field either, I just note that it's needed somehow. We need something like Ada's variant records [1], except where legal access is enforced at compile-time instead of via runtime Constraint_Error. type ObjectTypes is (Process, Node, ...) for ObjectTypes'Size use 8 type ProcessNode is array(1..32) of Capability type ObjectHeader (TypeCode : ObjecTypes, Id : UInt64) is record case TypeCode is when Process => Capabilities : CapNode; ... when Node => ... ... end case; end record; Sandro [1] http://www.isa.uniovi.es/docencia/TiempoReal/Recursos/textbook/aps12-4.htm On 27/02/2015 9:07 AM, Keean Schupke wrote:
|
_______________________________________________ bitc-dev mailing list [email protected] http://www.coyotos.org/mailman/listinfo/bitc-dev
