On Mon, 2004-09-27 at 13:04, Chip Salzenberg wrote:

> For Perl, I get that.  But for Python, AFAICT, namespaces are
> *supposed* to be in the same, er, namespace, as variables.  No?

Yes, and what's more the suggestion of using "::" in Parrot won't work
perfectly either (I'm pretty sure that there are LISP variants, possibly
including scheme) that use ":" in identifiers.

Rather than trying to shuffle through the keyboard and find that special
character that can be used, why not have each language do it the way
that language is comfortable (e.g. place it in the regular namespace as
a "variable" like Python or place it in the regular namespace, but
append noise like Perl or hide it in some creative way for other
languages). For the most part, there's no performance penalty in having
a callback that the language/library/compiler provides because access to
the objects in question will be via a PMC, and only LOOKUP of that PMC
will be via namespace, no?

In that way, you could:

        namespace_register      perl5_namespace_callback, "Perl5"
        namespace_register      python_namespace_callback, "Python"
[...]
        namespace_lookup        P6, "F\0o::Bar", "Perl5"
        namespace_lookup        P7, "foo.bar", "Python"

the namespace callback could take a string and return whatever Parrot
needs to look up a namespace (Array PMC?), having encoded it according
to Parrot's rules.

That way, you can solve this however you like (heck, put a  between
them if you want... in fact, I kind of like that).

-- 
â 781-324-3772
â [EMAIL PROTECTED]
â http://www.ajs.com/~ajs

Reply via email to