Quote: "So not missing, just require using the tools available."
No. missing - but there are workarounds that offers nearly the same functionality, but not quite. If a variable can have more than two values, it is not a boolean. And enums just do not exist in its' proper implementation where they got intrinsic functionality with no explicit assignment of value.
For instance in C/C++ I use enums for control structures like so:
enum modeSel {edit, browse, commit, restart};
typedef struct state_t{
modeSel mode;
};
void gameLoop(state_t &s){
while(s.mode != restart){
switch(s.mode){
case edit:
// do stuff
break;
case browse:
// do stuff
break;
case commit:
// do stuff
break;
}
if(endGameLose()){
s.mode = restart;
}
}
}
Simplified of course, all the fluff not needed to make the point deleted. Enums are not holders of value, but a user defined value in and by themselves. In fact, you could call a bool a standardized enum of two - true or false. Allthough, if one want to be nitpicky, those are just aliases for 1 and 0 - and in the C/C++ compiler user defined enums will be given an integer value as well. Which is fine for the machine, that is not the intended target for enums - people are. People programmers prone to producing complexity and interesting logical errors where none need be. Why enums were implemented to begin with. To make code easier to write and more importantly, to read and follow inside our very slow working wetware compiler.
How enums are implemented in Go underscores that an enum have no explicit value:
type modeSel int
const (
edit modeSel = iota
browse
commit
restart
)
It do look a bit as the AppGameKit workaround Markus wrote, except there is no need - or possibility - for value assignments. Though in Go you can assign operations and relations to enum definitions, which makes them quite the more powerful a tool than in C/C++ and well out of the scope of functionality I want for them in AppGameKit - which is basically a copy-paste of how they work in C/C++.