On Wed, 22 Oct 2003, Leopold Toetsch wrote:

> Simon Glover <[EMAIL PROTECTED]> wrote:
> >   Clearly there's a bug here, since the behaviour should be consistent;
> 
> I have changed the PerlInts to work like all others, thanks

 I don't think your fix is correct, since:

        new P0, .PerlNum
        new P1, .PerlInt
        new P2, .PerlNum

        set P0, 10.5
        set P1, 0
        or P2, P1, P0
        print P2
        print "\n"
        end  

 will now print 10, rather than 10.5 (which is better than the behaviour
 before the fix, but which is still not right).

 Having done some more nosing around, I see that PerlString doesn't 
 actually have its own implementation of logical_or; instead, it falls
 back on the scalar.pmc version, which does:

     void logical_or (PMC* value,  PMC* dest) {
        if (DYNSELF.get_bool()) {
            VTABLE_set_pmc(INTERP, dest, SELF);
        }
        else {
            VTABLE_set_pmc(INTERP, dest, value);
        }
    }  

 Is there a good reason why we're not doing the same thing for 
 PerlInt/Num/Undef?

 Simon
 

Reply via email to