This caused a number of Python tests to fail... specifically any tests
which were improperly depending on P2 as PDD03 states:
Note particularly that P0-P2 are not passed.
I'll go back and all the necessary interpinfo calls, but I feel
compelled to ask: why isn't P2 passed? It seems to me quite likely that
most methods will want to know what object they are working on.
- Sam Ruby
> I'll go back and all the necessary interpinfo calls, but I feel
> compelled to ask: why isn't P2 passed?
P2 is a non-preserved register and as such rather improper to hold the
object throughout a whole method.
> ... It seems to me quite likely that
> most methods will want to know what object they are working on.
Yes. Just use "self" which does all the magic you need inside a ".sub"
that is labeled "method".
> .namespace ['c']
> .sub m method
> $P4 = P2
> getprop $P5, 'p', $P4
> .return ($P5)
> .end
.sub m method
getprop $P5, 'p', self
.return ($P5)
.end
leo
I wasn't assuming is lasted throughout the whole method - only on entry.
>>... It seems to me quite likely that
>>most methods will want to know what object they are working on.
>
> Yes. Just use "self" which does all the magic you need inside a ".sub"
> that is labeled "method".
Thanks! That works.
- Sam Ruby