develooper Front page | perl.perl6.internals | Postings from February 2002

Re: PMCs, setting, and suchlike things

Thread Previous | Thread Next
From:
Graham Barr
Date:
February 14, 2002 06:32
Subject:
Re: PMCs, setting, and suchlike things
Message ID:
20020214143153.V66560@pobox.com
On Thu, Feb 14, 2002 at 02:10:20PM +0000, Dave Mitchell wrote:
> 2. If so, how do we distinguish between two PMCs, both of whose
> vtable pointers currently point to the 'Dog' vtable, but one of whom has
> been delared as type Dog and so should never have it's vatble pointer
> updated, and the other which started off as a 'plain' PMC, has temporariky
> becomes a Dog by beeing assigned to from a Dog value, but will change
> again the next time we assign something to it?

I may be way off here, but why does Parrot need to know its a Dog ? Thats
a perl level thing. To Parrot the PMC is an object, Dog would be a property
of the value, not the variable.

At the Parrot level the difference between

  my Dog $spot = new Dog;
  my $scalar = new Dog;

is that the prior would have an extra vtable entry to handle assignment.
That vtable method only needs to check that what is being assigned is
a PMC of the right type.

Graham.


Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About