Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re: Prototypes allow overloading subs?

by alien_life_form (Pilgrim)
on Dec 04, 2002 at 14:15 UTC ( [id://217480]=note: print w/replies, xml ) Need Help??


in reply to Prototypes allow overloading subs?

Greetings,

Mmmhhhh...
Not the java way for sure. If anything, I'd go the python way:

def foo(one,two=None,*args,**kwargs) : pass
So I can say:
foo(1) foo(1,2) foo(two=3,one=4,'fubar',three=42)
While perl's way may be too free form sometimes, trying to work around - for instance - C# idea of not allowing default values for arguments is a royal pain in the backend.
Cheers,
alf
You can't have everything: where would you put it?

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others sharing their wisdom with the Monastery: (6)
As of 2024-04-23 14:25 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found