Re: [luabind] Test for key on luabind class (userdata vs table?)
Brought to you by:
arvidn,
daniel_wallin
From: Christian <cn...@gm...> - 2013-10-26 18:46:49
|
Catching the error with pcall (and maybe checking if the error message is an expected one) is the only solution I can think of. From: Glen Fraser [mailto:hol...@gm...] Sent: Saturday, October 26, 2013 7:45 PM To: lua...@li... Subject: [luabind] Test for key on luabind class (userdata vs table?) Hi there, I know it's possible to set "properties" on luabind classes in Lua. You can set and get these keys, no problem. However, it doesn't seem possible to "get" (or test for the existence of) an unset key -- you'd expect it to return 'nil', but it crashes. Is there a way to test a luabind class for the existence of a key (as though it were a table), without crashing? [snip] Thanks, Glen. |