On Wed, Nov 01, 2006 at 05:53:24PM -0800, Jonathan Worthington via RT wrote:
> (sorry for empty reply earlier)
> 
> Patrick R.Michaud (via RT) wrote:
> > The new :vtable pragma doesn't seem to work when used on methods
> > of subclasses of core classes.  Here's a quick sample
> > (I'm also adding this test to t/pmc/parrotobject.t):
> >
> > <snip>
> >   
> Thanks for the good test case, which has enabled me to get a fix to this 
> bug. :-)

Excellent!  Now could you get it to work in .pbc files as well?  ;-)

(You may have already addressed this in other threads regarding saved
properties of subroutines, I just wanted to provide another test case
to show the current item I'm blocking on.)

    $ cat vt.pir
    .sub main :main
        $P99 = subclass 'Hash', 'Foo'
        $P99 = subclass 'Hash', 'Bar'
    
        $P1 = new 'Foo'
        $S1 = $P1
        say $S1
    
        $P1 = new 'Bar'
        $S1 = $P1
        say $S1
    
    .end
    
    .namespace [ 'Foo' ]
    
    .sub '__get_string' :method
        .return('Hello world')
    .end
    
    
    .namespace [ 'Bar' ]
    
    .sub 'get_string' :method :vtable
        .return('Hello world')
    .end
    
    $ ./parrot vt.pir
    Hello world
    Hello world
    $ ./parrot -o vt.pbc --output-pbc vt.pir
    $ ./parrot vt.pbc
    Hello world
    Hash[0x7e6be0]
    $

Thanks!

Pm

Reply via email to