On Tue, Sep 23, 2008 at 03:50:54PM -0500, Patrick R. Michaud wrote:
> However, for some reason 
> the change from to a MultiSub PMC is causing the 'sort' method dispatch 
> to FixedPMCArray to fail with "No applicable methods".  I'm looking into 
> FixedPMCArray now to see if I can find out why.

Here's a short PIR program that demonstrates the problem:

$ cat x.pir
.sub 'main'
    .local pmc arr
    arr = new 'FixedPMCArray'
    arr = 4
    arr[0] = 'just'
    arr[1] = 'another'
    arr[2] = 'perl'
    arr[3] = 'hacker'

    ## called with normal Sub, works
    $P0 = get_global 'cmpfn1'
    arr.'sort'($P0)
    $S0 = join ' ', arr
    say $S0

    ## called with MultiSub, fails
    $P0 = get_global 'cmpfn2'
    arr.'sort'($P0)
    $S0 = join ' ', arr
    say $S0
.end


.sub 'cmpfn1'
    .param pmc a
    .param pmc b
    $I0 = cmp_str a, b
    .return ($I0)
.end

.sub 'cmpfn2' :multi(_, _)
    .param pmc a
    .param pmc b
    $I0 = cmp_str a, b
    .return ($I0)
.end
$ ./parrot x.pir
another hacker just perl
No applicable methods.

current instr.: 'main' pc -34072556 ((unknown file):-1)
called from Sub 'main' pc 49 (x.pir:18)
$

Pm
_______________________________________________
http://lists.parrot.org/mailman/listinfo/parrot-dev

Reply via email to