Francois PERRAD wrote:
In a library (languages/lua/lib/luastring.pir), I declare a global
variable ("mt_string"):
.namespace [ "Lua" ]
.HLL "Lua", "lua_group"
.sub init :load, :anon
...
.local pmc _lua_mt_string
_lua_mt_string = new .LuaTable
global "mt_string" = _lua_mt_string
What is it wrong ?
First and foremost, it's hard to follow the problem, if there are
several snippets, a patch that fails, well, and a test that then
succeeds, if hopefully all steps are implemented.
Please provide one patch against svn head, relative to Parrot root that
contains everything to repeat the problem.
WRT subject: it seems to me that
global "mt_string" = _lua_mt_string
is storing into the global (root) namespace [1], while in LuaBase
'Lua::mt_string' is trying to be loaded. ('::' is the namespace
delimiter according to pdd21 and not to be taken literally)
[1] this will change, when pdd21 is fully implemented, i.e. it will
store into the current namespace then.
François.
leo