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

2004-12-12 Thread Leopold Toetsch
Sam Ruby [EMAIL PROTECTED] 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


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

2004-12-12 Thread Sam Ruby
Leopold Toetsch wrote:
Sam Ruby [EMAIL PROTECTED] 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


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

2004-12-11 Thread Sam Ruby
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/pmcdelegate.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
.sub main @MAIN
newclass $P0, 'c'
find_type $I0, 'c'
new $P1, $I0

new $P2, .PerlInt
$P2 = 1234
setprop $P1, 'p', $P2

$P3 = $P1.m()
print $P3
print \n
.end

.namespace ['c']
.sub m method
$P4 = P2
getprop $P5, 'p', $P4
.return ($P5)
.end