Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"

Re: List Wrapper for Object Methods.

by Prior Nacre V (Hermit)
on Dec 03, 2004 at 13:38 UTC ( [id://412117]=note: print w/replies, xml ) Need Help??

in reply to List Wrapper for Object Methods.

While I understand that this can be a little disconcerting, you shouldn't let it worry you.

Tutorials typically indicate this with examples like:

$game->draw; $sword->draw; $picture->draw; $blank->draw;

As an analogy, consider navigating a directory structure. When you type cd lib you will either change to a new directory (dependent on the current directory) or receive an error message (if no lib directory exists). Similarly, invoking the method draw() will either run some code (dependent on the class of the invocant) or will produce an error (Can't find method ...).

As you haven't indicated any inheritance in your question or code, I have avoided a discussion of polymorphism.

A musing: Could the analogy be extended to include polymorphism if I used David Korn's version of cd?



Log In?

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

How do I use this?Last hourOther CB clients
Other Users?
Others taking refuge in the Monastery: (2)
As of 2024-05-29 05:03 GMT
Find Nodes?
    Voting Booth?

    No recent polls found