-
Notifications
You must be signed in to change notification settings - Fork 1
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
Tables need supporting #24
Comments
it occurs to me, |
I agree, this is a priority now. Stay tuned for updates. |
Part of the design behind having a seperate |
As another interesting thought, code like below might be handy, but would require a different design for tables
This would require an overload
This design is unfortunately awkward, but you can't use This seems slightly hackish, so.... please think, critique, and discuss before implementing. |
That's why we have no table support yet. It's a complicated thing and hard to do right. I'll try to implement some for of prototype. |
It occurs to me that my suggestion thus far can't iterate over members of a table, that might be another use for table_element, or maybe not. The lua syntax is |
Just realized |
I wrote a little test program here http://coliru.stacked-crooked.com/view?id=6a21d5531a6e1849dcccb1e3b5a4b0d2-cc73e281b3b6abc9bf6cf4f153b944a6) just to figure out what sort of syntax should be suggested.
Since lua refers to the state of the lua engine, I thought it might be more consistent to replace lua.set_global(N,V) and lua.get_global(N) with lua.global().set(N,V), where lua.global() returns the "global scope", allowing it to have the same syntax as every other subscope, without treating the lua object itself like just another hashtable.
Here's some API I came up for my simple test:
Functions passing values in/out of lua should be any lua types like
lua::variant
, or types for whichlua::table assign_to_lua(lua::state& lua, const T& src, lua::variant& dst)
orT create_from_lua(lua::state& lua, lua::variant& src)
exist for cpp->lua and lua->cpp respectively.As mentioned, these are all just to get the ball rolling on conversation, any and all of this should be hotly debated before anyone codes anything.
The text was updated successfully, but these errors were encountered: