f***@prenav.com
2018-10-02 23:28:03 UTC
Hi.
I am trying to make a list of constant enumeration values in a capn proto
schema file.
enum foo{
unset @0;
bar @1;
bars @2;
}
const fooStates :List(foo) = [foo.unset, foo.bar, foo.bars];
However, the report of the parser is that unset is not a member of foo. I tried foo.Unset, foo.UNSET, foo::unset, foo::UNSET and nothing worked. foo.unset and foo.UNSET also failed due to unset (UNSET) not being a member of foo and foo::XXX fails due to a parse error.
I can workaround the language limitation by making a list of ints but that is prone to error in the face of changes to the foo enumeration.
const fooStates :List(UInt16) = [1, 2, 3];
Is there a way to make a list of enum values as a constant in a captn proto schema file?
Thanks in advance!
Forest
I am trying to make a list of constant enumeration values in a capn proto
schema file.
enum foo{
unset @0;
bar @1;
bars @2;
}
const fooStates :List(foo) = [foo.unset, foo.bar, foo.bars];
However, the report of the parser is that unset is not a member of foo. I tried foo.Unset, foo.UNSET, foo::unset, foo::UNSET and nothing worked. foo.unset and foo.UNSET also failed due to unset (UNSET) not being a member of foo and foo::XXX fails due to a parse error.
I can workaround the language limitation by making a list of ints but that is prone to error in the face of changes to the foo enumeration.
const fooStates :List(UInt16) = [1, 2, 3];
Is there a way to make a list of enum values as a constant in a captn proto schema file?
Thanks in advance!
Forest
--
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.
Visit this group at https://groups.google.com/group/capnproto.
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.
Visit this group at https://groups.google.com/group/capnproto.