On 27 February 2015 at 13:29, Sandro Magi <[email protected]> wrote:
>
> It might be if you could properly type the code I provided in my earlier
> message. You need to either store the type class dictionary or some sort of
> type descriptor in the table, but this is then no better then storing a
> function pointer, and hardly prescriptive to the extent shap seems to want.
>
>
Extensible records provide the required functionality I think. Something
like this:
data ObjectHeader = ObjectHeader {
id :: UInt64
}
data Capability = Capability {
id :: UInt65,
facet :: UInt16
}
data Process = Process {ObjectHeader | cap_node :: ArrayN Capacity 32}
data Objects = P Process | N Node ...
data Global {
obj_table :: ArrayN ObjectHeader Size,
running :: Process
}
kernel_msg_send cap_idx msg = let cap = global.running.cap_node[cap_idx] in
let obj = lookup(global.obj_table, cap.id) in case obj of
(P process) -> ...
(N node) -> ...
Keean.
_______________________________________________
bitc-dev mailing list
[email protected]
http://www.coyotos.org/mailman/listinfo/bitc-dev