On Sep 28, 2004, at 7:02 AM, Aaron Sherman wrote:

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's similar in spirit to what I proposed of allowing PMC-subclassing of the default ParrotNamespace, so that namespaces created from different languages (often implicitly) could have different behaviors. But I'd keep the pulling-apart of "F\0o::Bar" into ["F\0o"; "Bar"] a compile-time task, so that at runtime the work's already been done (since the compiler knows what language it's compiling).


JEff



Reply via email to