Matt Fowles <[EMAIL PROTECTED]> wrote: > Leo~ > Why bother with the IS_NULL check if we have the "n_" variant already? > Why not have one option unconditionally use the destination pmc and > the other unconditionally create a new destination pmc?
I think, we can just have one method with the same functionality. While it would work for the builtin one, the problem arises with overloading. For more complicated methods like "add" also a lot of code duplication is avoided. But overloading is still a problem anyway. When we have perl semantics: $a = $b + $c; the best way to translate it to PIR is probably: a = new PerlUndef # at scope start ... a = b + c # current op, modifying "a" in place But when infix<+> is overloaded the internal executed code has to be: temp = "__add"(b, c) # multi sub "__add" returns new val assign a, temp to achieve the same semantics like in the non-overloaded case. > Matt leo