{"action":"created","issue":{"url":"https://api.github.com/repos/urho3d/Urho3D/issues/820","labels_url":"https://api.github.com/repos/urho3d/Urho3D/issues/820/labels{/name}","comments_url":"https://api.github.com/repos/urho3d/Urho3D/issues/820/comments","events_url":"https://api.github.com/repos/urho3d/Urho3D/issues/820/events","html_url":"https://github.com/urho3d/Urho3D/issues/820","id":98670692,"number":820,"title":"Improve Lua binding for Variant and VariantMap classes","user":{"login":"weitjong","id":5548048,"avatar_url":"https://avatars.githubusercontent.com/u/5548048?v=3","gravatar_id":"","url":"https://api.github.com/users/weitjong","html_url":"https://github.com/weitjong","followers_url":"https://api.github.com/users/weitjong/followers","following_url":"https://api.github.com/users/weitjong/following{/other_user}","gists_url":"https://api.github.com/users/weitjong/gists{/gist_id}","starred_url":"https://api.github.com/users/weitjong/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/weitjong/subscriptions","organizations_url":"https://api.github.com/users/weitjong/orgs","repos_url":"https://api.github.com/users/weitjong/repos","events_url":"https://api.github.com/users/weitjong/events{/privacy}","received_events_url":"https://api.github.com/users/weitjong/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/urho3d/Urho3D/labels/enhancement","name":"enhancement","color":"84b6eb"}],"state":"open","locked":false,"assignee":{"login":"weitjong","id":5548048,"avatar_url":"https://avatars.githubusercontent.com/u/5548048?v=3","gravatar_id":"","url":"https://api.github.com/users/weitjong","html_url":"https://github.com/weitjong","followers_url":"https://api.github.com/users/weitjong/followers","following_url":"https://api.github.com/users/weitjong/following{/other_user}","gists_url":"https://api.github.com/users/weitjong/gists{/gist_id}","starred_url":"https://api.github.com/users/weitjong/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/weitjong/subscriptions","organizations_url":"https://api.github.com/users/weitjong/orgs","repos_url":"https://api.github.com/users/weitjong/repos","events_url":"https://api.github.com/users/weitjong/events{/privacy}","received_events_url":"https://api.github.com/users/weitjong/received_events","type":"User","site_admin":false},"milestone":null,"comments":4,"created_at":"2015-08-03T04:44:14Z","updated_at":"2015-08-05T15:15:54Z","closed_at":null,"body":"I am not an expert in Lua but it appears to me that there are code repetition in the bindings for these two classes. I suppose one could use Lua metamethod to handle ```__index``` event to return a Variant from a VariantMap and so those getter and setter bindings are only required for Variant class. Currently we have an incomplete bindings and yet those incomplete bindings are repeated in two places."},"comment":{"url":"https://api.github.com/repos/urho3d/Urho3D/issues/comments/128033285","html_url":"https://github.com/urho3d/Urho3D/issues/820#issuecomment-128033285","issue_url":"https://api.github.com/repos/urho3d/Urho3D/issues/820","id":128033285,"user":{"login":"weitjong","id":5548048,"avatar_url":"https://avatars.githubusercontent.com/u/5548048?v=3","gravatar_id":"","url":"https://api.github.com/users/weitjong","html_url":"https://github.com/weitjong","followers_url":"https://api.github.com/users/weitjong/followers","following_url":"https://api.github.com/users/weitjong/following{/other_user}","gists_url":"https://api.github.com/users/weitjong/gists{/gist_id}","starred_url":"https://api.github.com/users/weitjong/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/weitjong/subscriptions","organizations_url":"https://api.github.com/users/weitjong/orgs","repos_url":"https://api.github.com/users/weitjong/repos","events_url":"https://api.github.com/users/weitjong/events{/privacy}","received_events_url":"https://api.github.com/users/weitjong/received_events","type":"User","site_admin":false},"created_at":"2015-08-05T15:15:54Z","updated_at":"2015-08-05T15:15:54Z","body":"I am able to remove all of the Lua bindings for the VariantMap class in the Variant.pkg. The bindings are only exists in the Variant class as it should be. I am now attempting to remove all the binding for the setter methods in the Variant class by using a new metamethod to handle ```__newindex``` event. So, instead of\r\n```\r\neventData[\"Filter\"]:SetBool(true)\r\n```\r\nIt will be just (again similar to how it is done in C++ and AS)\r\n```\r\neventData[\"Filter\"] = true\r\n```\r\nFor this to work, I need to bind lua_Object (which is type less) to our Variant value in a generic manner. I think it can be done."}}