Re: Registries

Daniel Wallin <[email protected]>
Newsgroups gmane.comp.lib.boost.langbinding
Message-ID <5.1.0.14.0.20030714181835.03bd7f48__22157.832425046$1059273081@student.umu.se>
At 19:07 2003-07-13, David Abrahams wrote:
>Daniel Wallin <[email protected]> writes:
> > No, lua doesn't share python's concept of modules.
>
>OK, downloading lua, reading docs...
>
>Hmm, Lua is both cool (nice simple foundation, nice anonymous
>functions,...) and deeply disturbing.
>
><rant>
>
>The designers seem to have no problem letting coding errors pass
>silently.  I can't believe they made global variables the default and
>don't require an arity match for tuple assignment!  Ick, fully-closed
>ranges in for loops and 1-based indexing (how is that good in a
>language designed to interface with C/C++?)!  Ick, 'n' has special
>status as a table key!

By "tuple assignment" you mean multiple return values? It can be quite
convenient sometimes to not have arity checking there, although I agree
that it can result in coding errors getting passed by.
I agree with your other rants, global default in particular is disturbing.

>[and why can't I seem to call getn from the interactive interpreter?
>     $ lua
>     Lua 5.0  Copyright (C) 1994-2003 Tecgraf, PUC-Rio
>     > print(getn)
>     nil
>]

It should be "table.getn".

    > ./lua
    Lua 5.0  Copyright (C) 1994-2003 Tecgraf, PUC-Rio
    > print(table.getn)
    function: 0xa042350

>Hmm, the first draft of "Programming in Lua" seems wildly outdated.
>Maybe some of these problems are fixed?  No upvalues anymore, for
>example!  How do you learn this language these days?

Well, lua isn't as complex as python so it isn't that hard learning it, so 
I guess
you just read the reference manual and learn by trying. :)

> >> > When using multiple language bindings in the same system, it's
> >> > probably desirable to keep the cast-graph's separated.
> >>
> >>Why?  I can't see any good reason for that.
> >
> > You are right, there are no good reasons. I was confused.
> > All inheritance code can be shared directly.
>
>I was talking about the data structures.

Me too, but in my second post I for some reason decided to confuse you by
writing 'code' instead of 'graphs'. :)

>Given peoples' tendency to
>stick everything in the global namespace in C++, I guess we ought to
>consider having a separate cast graph for each group of interacting
>extension modules.  By "interacting" I mean that two extension modules
>manipulate some of the same C++ types and use them in their function
>interfaces.

Why? Do you mean because of type_info::name() comparing?
In that case we have the same problem of unique ID's with
the conversion registry as well.

>One question I have is, "how does a user say that this extension
>module interacts with these others, and what, precisely, does it mean
>internally?"

If the problem is the unique id's; do we really need to care about it?

---
Daniel Wallin



-------------------------------------------------------
This SF.Net email sponsored by: Parasoft
Error proof Web apps, automate testing & more.
Download & eval WebKing and get a free book.
www.parasoft.com/bulletproofapps1
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.