[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: dynamic vs. static typing
Pascal Costanza wrote:
> Anton van Straaten wrote:
> > A 'does not respond' error is a best case. A worse case is
> > sending a message to the wrong object that appears to be
> > understood - exactly the kind of error that can slip through
> > unit tests to manifest at runtime.
> It is my understanding that CLOS is a dynamically typed language in
> which this cannot happen because generic functions are globally unique.
> This ensures that if an object "happens" to understand a message then it
> does intentionally so.
> Or do you mean something else?
First, I didn't mean to imply that the case I mentioned applies to all
possible DT systems. In this case, Steve Dekorte's choice of the phrase
'does not respond' to characterize this kind of error led me to think of
systems like Smalltalk and Self, and my response was in those terms.
However, generic functions are not exempt from this sort of error. A
programmer can still invoke a method other than the intended one, by
providing a wrong parameter, for example. Doing this can result in the
invocation of a function other than the intended one. Errors like this can
be subtle and difficult to detect.