On Fri, Jun 29, 2007 at 11:45:18AM -0700, jerry gay wrote:
> On 6/29/07, Patrick R. Michaud <[EMAIL PROTECTED]> wrote:
> >On Fri, Jun 29, 2007 at 11:23:46AM -0700, jerry gay wrote:
> >> On 6/28/07, Patrick R. Michaud <[EMAIL PROTECTED]> wrote:
> >> >    .HLL "perl6", ""
> >> >        ...
> >> >        $P2 = get_class 'String'
> >> >        ...
> >> >    $ ./parrot z.pir
> >> >    Class 'String' doesn't exist
> >> >    current instr.: 'perl6;;main' pc 12 (z.pir:11)
> >> >    $
> >> >
> >
> >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.
>
> the get_class opcode takes a NameSpace PMC or a String, as per
> src/ops/object.ops:
> 
>  =item B<get_class>(out PMC, in STR)
> 
>  =item B<get_class>(out PMC, in PMC)
> 
>  Find the PMC for a class, by string name or by key.
> 
>  =cut
> 
> mind you, the documentation could be a bit more specific, but i expect
> that passing it a NameSpace PMC relative to the root namespace should
> work. 

This presumes that every PMC class also has a Namespace PMC associated
with it that points to the class.  I'm not sure that's true for 
Parrot PMC classes.

Pm

Reply via email to