I'm new to statically typed languages in general, I'm doing this as a
learning experience.
I'm building a toy UI toolkit, and I want to create a tree of widgets.
Something like
interface Node {
children @0 () -> (list :List(Node));
}
interface TextNode extends(Node) {
//some textNode specific stuff
}
My problem is that I want a node to be able to contain anything that
*implements* the node interfaces, even if it's a textNode, or an SVGNode,
or whatever. Is there a way to do that without resorting to using
AnyPointer or registering all my sub nodes in advance? Some provision for
doing structural typing?
--
You received this message because you are subscribed to the Google Groups
"Cap'n Proto" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
Visit this group at https://groups.google.com/group/capnproto.
To view this discussion on the web visit
https://groups.google.com/d/msgid/capnproto/04478ec6-c647-4d3f-a981-dc1bc6da6cae%40googlegroups.com.