On Fri, Jun 29, 2007 at 11:23:46AM -0700, jerry gay wrote:
> On 6/28/07, Patrick R. Michaud <[EMAIL PROTECTED]> wrote:
> >Another question about pdd15...:
> >
> >If I'm in a different HLL namespace (e.g., via a .HLL directive), how do
> >I get a PMC class from the 'parrot' HLL namespace?
> >
> >Here is an example (which obviously won't work):  I'm creating a
> >'perl6;Str' class and then attempting to add (parrot's) String class
> >as a parent.  But of course the constant 'String' here refers to
> >the wrong HLL namespace:
> >
> >    $ cat z.pir
> >    .HLL "perl6", ""
> >
> >    .namespace [ "" ]
> >
> >    .sub main :main
> >        # create 'Str' class
> >        $P1 = new 'Class'
> >        $P1.'name'('Str')
> >
> >        # add parrot;String PMC as a parent class
> >        $P2 = get_class 'String'
> >        addparent $P1, $P2
> >    .end
> >
> >    $ ./parrot z.pir
> >    Class 'String' doesn't exist
> >    current instr.: 'perl6;;main' pc 12 (z.pir:11)
> >    $
> >
> >Of course, I'm mostly interested in knowing what the answer "should be", 
> >but I'm
> >also interested in what "works today".
> >
> i've tried attacking this from a number of directions with current
> functionality, and can't seem to get anything to work.
> 
> note that this example only works if *both* the .HLL and .namespace
> lines are commented out. i can't quite figure out why that is, but
> i'll to stare at the C source a bit and see if something jumps out.

I think this is a case where the spec simply doesn't cover the needed
behavior yet, not that the implementation is missing something.

If I use C< get_class "String" > in a HLL other than parrot, 
then I somewhat expect the behavior we're already seeing.  In
other words, we're asking for a "String" class in the current
(HLL) namespace, and there isn't one, and thus we get an
exception.

So, the question is -- how do we locate PMC classes in other
HLL namespaces?

Pm

Reply via email to