Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

const #103

Open
TurkeyMan opened this issue Oct 4, 2016 · 0 comments
Open

const #103

TurkeyMan opened this issue Oct 4, 2016 · 0 comments

Comments

@TurkeyMan
Copy link
Contributor

Questions is, should LuaD types attempt to support const in some useful manner?
Obviously const has severe interactivity problems with Lua, but some parts of the LuaD API are awkward without const.
For instance, LuaTable.length(); surely a function that should be const... but it's a bit awkward since the function effectively mutates the Lua stack to get the length of the table (push, get length, pop).
Thing is, it returns the Lua stack to the exact state that was before calling the function, so it's effectively const, even though it's technically not.
Should the LuaD API allow that functions that return the Lua stack to their initial state and have no other side-effects on the LuaState may be const? It will require some hard-casts, but it may reduce a lot of friction when typical D code is trying to make use of LuaD...?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant