6 Matching Annotations
  1. Dec 2018
  2. Oct 2017
    1. Ad hoc polymorphism: when a function denotes different and potentially heterogeneous implementations depending on a limited range of individually specified types and combinations. Ad hoc polymorphism is supported in many languages using function overloading. Parametric polymorphism: when code is written without mention of any specific type and thus can be used transparently with any number of new types. In the object-oriented programming community, this is often known as generics or generic programming. In the functional programming community, this is often shortened to polymorphism. Subtyping (also called subtype polymorphism or inclusion polymorphism): when a name denotes instances of many different classes related by some common superclass.[3] In the object-oriented programming community, this is often referred to as simply Inheritance.

      个人认为 这里其实 ad hoc 和 subtype 是有相近之处的 都是一样东西 比如 function 或者 object, 我们使用不同的角度去看 比如 不同 parameter 和 type 可以得到(部分)不同(也可能相同)的实现. (其实对于 object 应该是相同?) 这里倾向于去利用一个东西 as a user

      而 parametric polymorphism (generic/template) 这是在接受一个对象 (as an implementer) 时候 对于该对象的类型不限定, 而是使用固定的手段去操作

      as a user: 限定名字 不限定操作方法 as an implementer: 限定操作方法 不限定名字

  3. Jun 2017
  4. Apr 2017