Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> Polymorphism in this instance is simply allowing you to call the same function with an integer and string respectively.

Er... no, that's not polymorphism, that's overloading.



In computer science, polymorphism is a programming language feature that allows values of different data types to be handled in a uniform manner.

This may be ad hoc polymorphism (often synonymous with overloading) - or parametric polymorphism (as in ML or Haskell); but it's unclear what they actually do without some language semantics.


And to be more complete, OO-style polymorphism is usually referred to as "subtype polymorphism" and the parametric polymorphism dons talked about is like C++ or Java "generics"




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: