<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Oct 13, 2015 at 9:27 PM, Auke Booij <span dir="ltr"><<a href="mailto:auke@tulcod.com" target="_blank">auke@tulcod.com</a>></span> wrote:<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">I really don't understand this discussion. Is the claim that the usage<br>
of enums in java is problematic, because inserting a new value in an<br>
existing enum might change the index of later values, thereby creating<br>
an inconsistency?<br></blockquote><div> </div><div>Correct. </div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<br>
If so, all I can say that clearly the object you want to associate<br>
with wayland-style enums is not whatever Java has invented for an<br>
"enum". The values that are associated to names inside wayland enums<br>
are very clear-defined, and if a language cannot safely couple names<br>
back to values, then that is a language that does not understand the<br>
concept of a variable. If this is a fundamental problem about Java<br>
enums, you better find a way around it, but I don't see how this is in<br>
any way a problem on the wayland side: there are enums, and enums<br>
contain names, and those names have values.<br></blockquote><div> </div><div>If wayland enums would not explicitly declare values, you'd have the same problem in C. However since wayland enums do explicitly declare their value, *and* because C allows you to override an enum 'internal value', you don't have that problem here. Unfortunately, Sun in all it's infinite wisdom decided that Java enum 'internal values' can not be overridden. Only new 'properties' can be attached.</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<br>
But if this is indeed the issue you are discussing, then this must<br>
have already been a problem before the introduction of additional XML<br>
attributes.<br></blockquote><div> </div><div>Correct. My current Java bindings create a Java enum with the wayland enum value as an additional property. If the order would change, that would be a potentially breaking change. </div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">Can we agree on the following? Until there is any firm specification<br>
of open/closed enums, every enum should be considered open, and<br>
although some legal values might be listed, others might not be, and<br>
some might only be legal sometimes. </blockquote><div><br></div><div>Ok for me but it would be very nice to have the open/closed information ;)</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">New values may be added (but not<br>
changed or removed) to protocol specifications without introducing any<br>
compatibility issues.<br></blockquote><div><br></div><div>This is not clear for me. Compatibility issues for the current C bindings or for all language bindings? If it's for all language bindings than this might introduce a whole explosion of derived implicit specifications for each language. Eg. the enum order in Java. Better would be to specify a goal "no compatibility issues" and a set of form specifications eg. "the order of an enum shall not be changed".</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<div><div>_______________________________________________<br>
wayland-devel mailing list<br>
<a href="mailto:wayland-devel@lists.freedesktop.org" target="_blank">wayland-devel@lists.freedesktop.org</a><br>
<a href="http://lists.freedesktop.org/mailman/listinfo/wayland-devel" rel="noreferrer" target="_blank">http://lists.freedesktop.org/mailman/listinfo/wayland-devel</a><br>
</div></div></blockquote></div><br></div></div>