hi,

My question concerns functionality of PMCs and Objects.

while reading the docs about the functionality of classes and objects, I read that the vtable entries of a class can be overridden to give the class special behaviour. I'd like to know if I'm correct (I just realized this), if I say that: you can give a variable the same behaviour by either write it as a pmc, or as class. When giving the functionality to a PMC, you write it in C, when doing it with a class, you write it in PIR. Am I correct?

If so, why then would one ever want to write a PMC (maybe for speed?) (for example, as a language implementer). My point is, you could also override the vtable entries just in PIR, which is (in my opinion) a bit easier to do. Add to that the advantage that you don't have to distribute your language's PMC collection (FooInt, FooFloat, FooString, etc.) but the only thing a user would need is the compiler.

Furthermore, if my assumption above is correct, then "morphing" and stuff works the same way?

Thanks in advance,

klaas-jan

Reply via email to