|
|
|
|
|
by dllthomas
4239 days ago
|
|
So, wikipedia says (http://en.wikipedia.org/wiki/Duck_typing#Structural_type_sys...): "Duck typing is similar to but distinct from structural typing. Structural typing is a static typing system that determines type compatibility and equivalence by a type's structure, whereas duck typing is dynamic and determines type compatibility by only that part of a type's structure that is accessed during run time." So it sounds like "duck typing" is defined in terms of run-time semantics. I guess you might be able to have genuine "compile-time duck typing" in a dependently typed language, which could be a good reason to preserve the distinction. Otherwise, yes, they are certainly similar. |
|