Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re^2: [parrot] parrot prototype OO?

by jepri (Parson)
on Feb 06, 2008 at 03:31 UTC ( #666454=note: print w/ replies, xml ) Need Help??


in reply to Re: [parrot] parrot prototype OO?
in thread [parrot] parrot prototype OO?

Hmmm, find_method seems to be called on the superclass, and not the class (or on the class and not the object). So if I try to use, say, objects, should I return a method that inspects the object (and its parent* slots) and then calls the correct method? Because that sounds like I'm implementing AUTOLOAD.

Here's my naive code. I don't seem to be making good use of the class machinery so far:

.namespace [ 'MyStuff'; 'TestProt' ] .sub 'autoload' :method #inspect object and parents here .end .sub 'find_method' :vtable .param pmc arg0 .param pmc arg1 .local pmc autoload new_method = find_name 'autoload' .return(new_method) .end .sub main :main $P1 = new [ 'MyStuff'; 'TestProt'] $P1.hi() .end

___________________
Jeremy
I didn't believe in evil until I dated it.


Comment on Re^2: [parrot] parrot prototype OO?
Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://666454]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (13)
As of 2014-08-22 18:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (163 votes), past polls