Dan Sugalski <[EMAIL PROTECTED]> wrote:
> I'm poking around in the object stuff today, to try and get at least
> single-inheritance objects up and running.

> At the moment, I'm torn between just having a new method of some sort in
> the class and having a vtable method on the class PMC that returns an
> object of that class. (get_pmc on the class returns a new object, or
> something of the sort)

While get_pmc is totally unused the name is probably misleading. It
accompanies set_pmc, which is basically C<assign>. When I'm thinking of
get_pmc, ties and refs come to my mind (that get the PMC they are
referring to), but no new objects.

So probably a new vtable would be better. Or alternatively:
(If you didn't think of the same above :)

You put it into the find_method/callmeth scheme that we already have
(and use in parrotio.pmc) for PMCs.
That would mean: on class_init all (instantiable) PMCs get a NEW method
(maybe inherited from default.pmc) which does pmc_new()/init() on the PMC
class, which for parrotclasses does the Right Thing.
This is one extra lookup for the NEW method, but could be useful for
ultimate flexibility.

s. classes/{parrotio,default}.pmc and t/pmc/io.t for the method stuff.

>                                               Dan

leo

Reply via email to