On Sunday 06 April 2008 09:33:06 chromatic wrote:

> On Sunday 06 April 2008 02:17:07 Jonathan Worthington wrote:

> > The behavior looks sane to me. .include is, quite literally, textual
> > inclusion, nothing more. The get_namespace instruction is always
> > relative. The code should probably be using an absolute namespace op,
> > such as get_hll_namespace (or get_root_namespace), which looks up from
> > the appropriate root. I understood get_namespace as doing a relative
> > lookup within the current namespace.

> That's what the documentation suggests as well, but I have difficulty
> imagining code where I'd *want* the existing behavior of get_namespace.

... compounded by the fact that I can't seem to get any of the existing 
namespace ops to do what I want in a concise, non-hacky way.  What am I 
missing?

        .namespace [ 'Foo' ]

        .sub 'main' :main
                load_bytecode 'runtime/parrot/library/Test/More.pbc'

                # get the testing functions
                .local pmc exports, curr_namespace, test_namespace
                curr_namespace = get_namespace
                test_namespace = get_root_namespace [ 'Test'; 'More' ]
                exports = split " ", "plan diag ok is is_deeply like isa_ok 
skip"

                $I0 = defined test_namespace
                say $I0
                test_namespace."export_to"(curr_namespace, exports)
        .end

-- c

Reply via email to