Category:Typing/Compatibility/Duck: Difference between revisions

From Rosetta Code
Content added Content deleted
No edit summary
(Added some explanatory text)
 
Line 1: Line 1:
{{feature|Typing/Compatibility}}
{{feature|Typing/Compatibility}}
A typing scheme commonly used by dynamic languages.
A [[wp:Duck typing|typing scheme]] commonly used by dynamic languages.
:''If it walks like a duck and quacks like a duck, I would call it a duck.''
:''If it walks like a duck and quacks like a duck, I would call it a duck.''
For example, with [[:Category:Typing/Compatibility/Structural|structural typing]] a “get the <tt>x</tt> element of a structured type” operation will only apply to one type (or its subtypes), but with duck typing it will apply to ''any'' structured type that has such an element. It is common for duck-typed languages to use [[:Category:Typing/Checking/Dynamic|dynamic typing]] too.
More information on [[wp:Duck typing|Wikipedia]].

Latest revision as of 16:44, 29 August 2009

Typing/Compatibility/Duck is a programming language feature.

A typing scheme commonly used by dynamic languages.

If it walks like a duck and quacks like a duck, I would call it a duck.

For example, with structural typing a “get the x element of a structured type” operation will only apply to one type (or its subtypes), but with duck typing it will apply to any structured type that has such an element. It is common for duck-typed languages to use dynamic typing too.

Subcategories

This category has the following 14 subcategories, out of 14 total.

A

B

C

E

  • E(3 C, 269 P)
  • Ela(3 C, 66 P)

F

K

M

S

T

  • Tcl(4 C, 983 P)
  • Trith(3 C, 21 P)