"Lyle Johnson" <ljohnson / resgen.com> writes: > I checked the FAQ but didn't see this one addressed. Is there any automatic > way to assign a range of integer values to a set of names, like "enum" > values in C/C++? The current approach I've taken, which isn't pretty, is > just: > > ID_FIRST_VALUE = 0 > ID_SECOND_VALUE = ID_FIRST_VALUE + 1 > ID_THIRD_VALUE = ID_SECOND_VALUE + 1 > ... etc. ... > > Those aren't the real names of the constants, but you get the idea Ah, the old "names have been changed to protect the constants" routine, eh.. A common idiom is just to use symbols, either directly: window.setStack(:TOP) or via constants TOP = :TOP BOTTOM = :BOTTOM This doesn't work if you want to do or-ing and such, but for the kinds on enums you're describing it seems to be just fine. Dave ps. Any idea on my swig problem with static structs?