So, you want method overloading, I take it? It is a very nice feature and
I've used it often in another language. Well, you basically can't have it
unless you have type checking of the arguments. And the more strong the type
checking, the less dangerous and the more effective the method overloading,
since the method signatures get more specific. Others on this list say that
strong typing cramps their style and restricts their free-form-dom while
writing code. I posit that restrictions can lead to *more* freedom, not less,
since there is more you can rely on. Consider the beauty of a fast and
complex Irish ceili dance and how one clumsy beginner can easily break someone
else's ankle, and you see that the very strict rules of that dance are
necessary for the freedom to dance it without getting hurt. No rules lead to
"high school kids lean against one another and grope in the dark", which is
only euphemistically called "dance". Programming is not so dissimilar. I
think you have brought up another example where the lack of strong enforcement
of rules reduces freedom by preventing a nice feature.
Daniel
"David L. Nicol" wrote:
> Coming to Perl 5 from a C++ background, I was greatly
> disappointed,
....
> Multiple dispatch based on argument type, gentlemen. C++ has it, and
> C++ programmers miss it when writing in other languages. Few other
> languages
> dare to include argument types into the symbolic identifiers for their
> code entry points.
>
> In the land of More Than One Way, it is surprising that this important
> way -- the mechanism behind, for example, the double-angle-bracket C++
> streams library output syntax -- early-binding multiple dispatch based
> on known argument type -- is missing.
>
> --
> David Nicol 816.235.1187
> Signature closed for repaving