lua-users home
lua-l archive

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


For example, one cannot create the module 'mymodule.assert' or
'mymodule.error' if the basic library is loaded in the Lua state.

It seems to be working fine here. Can you send a small set of scripts
that fails? I wrote a file called error.lua, and placed in a directory


    a = 1
    b = 2

    print("why not?")

Then I wrote the following:

    Lua 5.0.2  Copyright (C) 1994-2004 Tecgraf, PUC-Rio
    > print(error)
    function: 00364BF8
    > e = require("test.error")
    why not?
    > for i,v in e do print(i,v) end
    a       1
    _NAME   test.error
    _PACKAGE        test.
    b       2

What should have happened?

In Lua 5.1, we have the _M field in the namespace, pointing to itself.
It works like the _G field, but only for modules. The new version of
compat will do the same.