On Nov 23, 2005, at 4:39 AM, Roger Browne wrote:

On Tue, 2005-11-22 at 22:42 -0500, Will Coleda wrote:
  .HLL "foo", ""      # or "foo_group" - load dynamic PMCs too
  .HLL_map .LexPad -> .DynLexPad           # (2)


I'd like to provide an easy way to provide this mapping for language
developers so the users of the language don't have to remember to add
the second line whenever they use, e.g. Tcl...

Seems like the cleanest thing to do is add a subclass for DynLexPad
(with no overrides) and map it in the PMC definition to LexPad.

Why bother with an artifical subclass? You could choose an arbitrary
Tcl PMC and do the mapping of DynLexPad to LexPad in the class_init
of that arbitrary PMC.

You wouldn't need another 'pmclass' keyword if you call
Parrot_register_HLL_type.


Mainly to avoid having the C code in my .pmc: I'd rather have a way to declare things in the PMC and have that generate code via pmc2c.pl. (Same reason I just added the hll/maps directives.)

I can, of course, add the C now, and have it be functional. I was just pondering what might be a simpler way for future PMC authors.

Regards,
Roger Browne



Reply via email to