Re: Registries

David Abrahams <[email protected]>
Newsgroups gmane.comp.lib.boost.langbinding
Message-ID <[email protected]>
Daniel Wallin <[email protected]> writes:

> At 18:54 2003-07-16, David Abrahams wrote:
>>Daniel Wallin <[email protected]> writes:
>>
>> > Could you explain more how the modules would nest,
>>
>>I don't understand the question.  Python has module (package)
>>hierarchies, so a top-level module foo might have a sub-module foo.bar
>>
>>Users can create submodules by sticking them in a package hierarchy,
>>or by opening a new module scope with
>>
>>    module('bar') [ ... ]
>>
>>if we accept the luabind syntax.
>
> Oh ok, I wasn't aware of how Pythons module system works. So when
> you import a submodule, the parent module is automatically loaded as
> well?

I think that's effectively true.

> Anyway, this means the scoped converters would be python specific,
> or at least not supported by lua. (since lua doesn't even have
> modules in the python sense).

I don't see why not.  You seem to have support for them in luabind,
and it does make a convenient way to reflect nested namespaces.

>> > or by just invoking it. :)
>> >
>> >    int main()
>> >    {
>> >      lua_State* L = lua_open();
>> >      lua_pushstring(L, "my_fun");
>> >      lua_pushcclosure(L, &my_fun, 0);
>> >      ..
>> >    }
>>
>>You can't "just invoke it" from Lua, so you must be talking about
>>embedding Lua in another app in this case.
>
> Yeah, to clarify: Most common usage is to just embed lua in your app
> and export your bindings directly to the lua state. I don't think
> it's very common to use lua as a standalone interpreter, although
> people probably do that as well.

OK.

-- 
Dave Abrahams
Boost Consulting
www.boost-consulting.com
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.