[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Lua 5.3 Suggestion: extend lua_(get|set)uservalue() to associate userdata-to-userdata
- From: Sean Conner <sean@...>
- Date: Mon, 2 Dec 2013 17:16:58 -0500
It was thus said that the Great Philipp Janda once stated:
> Am 02.12.2013 07:01 schröbte Sean Conner:
> >It was thus said that the Great Sir Pogsalot once stated:
> >>I am saying that it is out of my control, as it is done by code I did not
> >>write. So the metatable check works but the subsequent rawlen() fails.
> >
> > That's what I'm not understanding---the call to lua_rawlen(). To me, it
> >sounds like a defensive programmer going overboard. Personally, I don't
> >believe in defensive programming as it hides bugs [1]. Trust the
> >programmer; do NOT trust the outside world though.
>
> ... and don't trust that two programmers that have never even talked to
> each other will always produce compatible code.
>
> Consider two C extension modules written by different authors, which use
> the same name for `luaL_newmetatable` but for different C types. No
> trust in either programmer will prevent a crash when a user loads both
> modules.
And that brings us back to the whole namespace issue. Odd how that keeps
coming up.
-spc (And asking, has anyone encountered that issue?)