lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

You don't, because they are represented by the same type on the Lua
side. Isn't that obvious?

Yes that was the point.

2010/1/12 Daniel Wallin <>
liam mail wrote:
> Sorry looking again at your posted code
> @@ -244,6 +244,8 @@ namespace luabind { namespace detail
>     {
>         object_rep* result = static_cast<object_rep*>(lua_
> touserdata(L,
> index));
> +        return result;
> +
>         if (!result || !lua_getmetatable(L, index))
>             return 0;
> The code you posted only checks
> that the userdata has a metatable not that it is an actual object_rep from
> what I see.

If you actually looked at the code rather than the diff context you
might have noticed that it *does* check that.

> Just as you have a method to turn this off locally I may introduce a define
> to turn it on if a user so requires, in a future release.

Yes, and that will make the benchmark results different.

Daniel Wallin
BoostPro Computing

Following is a copy of the message I have posted to other places where the release data was posted.
I apologise for including a link to the profile results as some people think it is just not fair and you will find the numbers confusing. I would like to add that OOLua may not be what you are looking for, but also Luabind may not!
The Luabind author is complaining because OOLua and Swig draw a line between checking what you pass to a function which requires data created by the libraries and a user passing completely incorrect data.

In a future version I will add the ability for a user to define if a check should be made on every instance passed to it that it actually created the data, this will of course impose a penalty for using the library correctly. On the other hand if it is intended to allow third parties to write scripts this could be seen as the correct action to take.