News for hackers. Stuff that matters.
Re:Design mistakes in mixed C/C++ and Lua projects by jmaygarden on Friday October 21, 2011 @12:00AM (#3138342)
He's making a C API call to essentially compare two integers instead of just comparing them directly in Lua. You can fix that by pushing the enum values to Lua as numbers instead of userdata with metatables for comparisons.
Re:Design mistakes in mixed C/C++ and Lua projects by phaedrus on Friday October 21, 2011 @12:15AM (#3138390)
Well it's Io but you're still correct, I could fix that by letting enums "decay" into Numbers. In fact, I originally had that happen accidentally and I actually considered it a bug. The reason I considered that a bug was that I made a design decision to strongly type everything that goes across the boundary between script and C++.