Multiple dispatch branch merged

Will Coleda will at coleda.com
Tue Oct 7 15:24:39 UTC 2008


On Tue, Oct 7, 2008 at 9:50 AM, Will Coleda <will at coleda.com> wrote:
> On Tue, Oct 7, 2008 at 4:25 AM, Allison Randal <allison at parrot.org> wrote:
>> It looks like t/cmd_expr.t is getting a float-ish value where it expects an
>> int-ish value (which could be a multi dispatch to the wrong variant).
>
> Tcl's pmcs weren't updated, so they're still trying to setup MMD the
> old way. I'll see if I can fix this.

Updated and simplified; I had been overriding division so that integer
division didn't auto-promote to float.

Looks like pow has changed though: [expr 2**3] used to return a tclint
8, now it returns a tclfloat 8.0; Looks like this does the same thing:

.sub main :main
 $P1 = new 'Integer'
 $P1 = 2
 $P2 = new 'Integer'
 $P2 = 3
 $P3 = $P1 ** $P2
 $S0 = typeof $P3
 say $S0
 $P3 = $P1 ** 3
 $S0 = typeof $P3
 say $S0
.end

generates "Float\nInteger", I'm pretty sure that before the merge it
would have been "Integer\nInteger".

Is this desired behavior on the parrot types? If so, I can update tcl
to override pow just like divide. (3 remaining t/cmd_expr.t test
failures now, all related to the pow vtable)

-- 
Will "Coke" Coleda


More information about the parrot-dev mailing list