[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: C API const correctness
- From: "John Belmonte" <jvb@...>
- Date: Fri, 6 Oct 2000 16:41:42 +0900
It would be nice if someday the C API was made const correct. I'm referring
to the lua_State argument of all the API functions. If a function does not
affect the state, the state pointer argument should be qualified as const.
Const correctness is an important part of any interface because it lets the
user know which pass-by-pointer arguments may be modified, and lets the
compiler check the pointer use.
Of course this wouldn't be a trivial correction to Lua because the const
correctness would have to trickle down into the whole implementation. As a
benefit the implementation would become more readable because all function
interfaces would be clarified.
For now, if someone on the Lua team would at least make a list of API
functions that don't modify state I will cast to const manually in a wrapper
API.
Regards,
-John