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

Draft for tables support #26

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

Draft for tables support #26

wants to merge 4 commits into from

Conversation

ghost
Copy link

@ghost ghost commented Sep 24, 2013

This is a "fixed" version of the first branch commit I submitted some time ago.

RELATED: #24

THIS BREAKS EVERYTHING

It is a rough version that demonstrates the way I see tables could work in lundi.

  • I have not taken into account yet @Ambeco's suggestions. I will.
  • The way references are one of the variant's supported types maybe changed. I think it makes sense, but not for tables.
  • Tables are meant to be constructed from references (it's just an interface). There should be a way to check if the referenced object is indeed a table when constructing.
  • Not having tables in the variant means we have to make a special case for them in the different binding entry points (exposing functions, proxies, etc)
  • The reference type is a handle to a table entry inside lua. The index is the identity of the C++ reference object itself. Therefore, we get reference counting for free (implemented inside lua). However, copying is more expensive than if we used luaL_ref and a C++ reference counter.
  • I moved push/pop to variant.hpp and tried to tidy up the dependencies between classes. I think there's too much stuff in state.
  • We need to implement range compatibility
  • I am NOT HAPPY with the way I handled push and pop

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

Successfully merging this pull request may close these issues.

1 participant