3 ms·
Duck typing is more of a technique than a quality of a language. Any dynamically-typed language is going to end up having some code that does runtime type check
by djur 12y ago
Duck typing is more of a technique than a quality of a language. Any dynamically-typed language is going to end up having some code that does runtime type checking. Duck typing just means doing respond_to? instead of :kind_of? when doing so.
Ruby is certainly a language suitable for the duck typing technique. The term was originally used in reference to Python, and both languages have reasonably equivalent reflection abilities.