Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re^2: Are prototypes evil?

by Aristotle (Chancellor)
on Sep 03, 2002 at 13:37 UTC ( #194763=note: print w/ replies, xml ) Need Help??


in reply to Re: Are prototypes evil?
in thread Are prototypes evil?

Then again, that might only happen at run-time.

That's not a "might", it's bullseye.

The compiler cannot know what's going to happen. You might think it will; if you see foo(@bar) and the prototype is ($), it's obviously a violation, right? But what happens when I have foo(bar())? In fact, the function might return a single return value some of the time and multiple ones at other times. There's no way for the compiler to know. It can only be determined at runtime. Prototypes as they're known from statically, strongly typed languages are not possible in Perl due to the very nature of the language.

Makeshifts last the longest.


Comment on Re^2: Are prototypes evil?

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (6)
As of 2014-12-18 01:50 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (41 votes), past polls