Patrick R. Michaud wrote:

The one I'm likely to want to go with is to follow Perl 6's model,
which is that 'new' will be a method on a PGE::Match proto-object.
Indeed, I think that PGE also relies on Match objects themselves
being able to respond to 'new'.

So, the model I'd expect to ultimately aim for is something like:

    $P0 = get_hll_global [ 'PGE' ], 'Match'
    (mob, pos, target, mfrom, pos) = $P0.'new'(mob, adverbs :flat :named)

In this example it doesn't matter if $P0 is the actual class
object -- it can just be an instance of PGE::Match that
knows how to deal with the 'new' method (either because it's a
method in the class or because it's specifically composed into
the protoobject).

Most of the compiler tools are being created based upon this
model of object creation -- i.e., there's a proto-object
somewhere that is accessed via normal symbol table lookups,
and a 'new' method on that object is used to create an instance
of the class.

Okay. That happens internally and doesn't touch the external interface of Parrot to PGE, so it's up to you.

I can go ahead and switch PGE to use a model like this in the
trunk branch if that would help.

It would help greatly. PGE is bootstrapping itself heavily enough that I can't get through Parrot's top-level 'make' without dying on the non-functional 'new' method.

For the moment, I've commented PGE and TGE out of the Makefile, so I can run 'make test' and keep working on the rest of the system.

Note that PGE also uses a similar 'newfrom' method that has been
left in for compatibility with older versions of PGE -- eventually
those should also be converted into calls to 'new'.

Makes sense.

Allison

Reply via email to