Attention PMC class implementors! Sometimes you'll not feel like
implementing some vtable method or other. Don't worry; instead of
bloating Parrot with loats of functions which do exactly the same thing
in deriving common operations like "logical_or" from first principles,
you can now inherit them from a default class. If you say, as perlnum.pmc
does:

 void logical_or (PMC* value, PMC* dest) = default;

you'll recieve a function Parrot_default_logical_or in your vtable which 
does the Right Thing. Doesn't that mean that you need to include some header
file so that the compiler can find the prototype? Don't worry, we've 
thought of that too, and pmc2c will add the #include for you automagically.

default.pmc contains only two functions at present, logical_or and
logical_and. I'm sure there are others that can be done from first principles.
The eagle-eyed will also note that it takes advantage of the new "noinit" flag
to pmclass which means that pmc2c won't generate an init function. Isn't that
clever?

Enjoy,
Simon
-- 
<dngor> Every little bit of seaweed kelps.

Reply via email to