enum brands?

18 views
Skip to first unread message

Ian Denhardt

unread,
Oct 30, 2020, 3:41:52 PM10/30/20
to capn...@googlegroups.com
Hey all,

I was looking at schema.capnp, and noticed that the enum variant of the
Type struct has a brand field. This doesn't make sense to me: unless I'm
missing something, enums can't contain pointers, so it doesn't make
sense to have type parameters on an enum. What is this field for?

-Ian

Kenton Varda

unread,
Oct 30, 2020, 3:49:39 PM10/30/20
to Ian Denhardt, Cap'n Proto
I probably did it for consistency. It's true that, at least at present, it's not in any way meaningful for an enum to be parameterized. Moreover, you cannot declare parameters in an enum declaration. However, an enum could be nested within a parent scope that is parameterized, and in theory everything within the scope is subject to those parameters -- but indeed, since an enum type has no opportunity to refer to any parameter in its definition, it is meaningless in practice.

-Kenton

--
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 capnproto+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/capnproto/160408690654.5900.1088050232156870835%40localhost.localdomain.
Reply all
Reply to author
Forward
0 new messages