jepri has asked for the wisdom of the Perl Monks concerning the following question:
At first I thought to simply subvert the classes and use them as objects, but there are no class methods, so that was out. Then I thought I might try to mess with the metaclass, which does appear to have "class methods", but when I cloned it I couldn't seem to make one the parent of the other.
So it seems I'm left with writing my own prototype PMCs (ouch), writing some complex objects to proxy calls, or throwing the whole lot away and doing it all with closures. I might have missed a trick, but PDD15 gets prototypes slightly wrong*, so I suspect there really is no good way to do it right now.
Does anyone have some hot ideas on how to arrange inheritance between objects in parrot? Or to give classes methods?
* It states that prototype systems have no classes, but skips over the fact they still have inheritance. A better way to put it might be that prototype systems don't have objects.
(Edit) References:
Prototypes explained
PDD15
Prototypes in Perl5
___________________
Jeremy
I didn't believe in evil until I dated it.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: [parrot] parrot prototype OO?
by chromatic (Archbishop) on Feb 05, 2008 at 19:08 UTC | |
by jepri (Parson) on Feb 06, 2008 at 01:07 UTC | |
by jepri (Parson) on Feb 06, 2008 at 03:31 UTC |