Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Re: cvs commit: parrot/t/pmc delegate.t object-meths.t objects.t sub.t

6 views
Skip to first unread message

Sam Ruby

unread,
Dec 11, 2004, 9:35:55 PM12/11/04
to perl6-i...@perl.org
Leopold Toetsch wrote:
> cvsuser 04/12/11 04:08:13
>
> Modified: classes sub.pmc
> imcc/t/syn op.t
> runtime/parrot/library parrotlib.imc
> src inter_run.c
> t/op gc.t
> t/pmc delegate.t object-meths.t objects.t sub.t
> Log:
> more pdd03 cleanup
> * P0, P2 aren't visible in caller aynmore

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

test.pir

Leopold Toetsch

unread,
Dec 12, 2004, 3:31:17 AM12/12/04
to Sam Ruby, perl6-i...@perl.org
Sam Ruby <ru...@intertwingly.net> wrote:

> 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

Sam Ruby

unread,
Dec 12, 2004, 9:00:40 AM12/12/04
to l...@toetsch.at, perl6-i...@perl.org
Leopold Toetsch wrote:
> Sam Ruby <ru...@intertwingly.net> wrote:
>
>>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.

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

0 new messages