Smalltalk = strongly typed?
Blake
blake at kingdomrpg.com
Thu Oct 14 06:43:56 UTC 2004
I've been reading a lot of discussions of strong/weak typing versus
static/dynamic typing.
I've seen a number of statements that assert that Smalltalk, while
dynamically typed, is also strongly typed.
Dynamic, I get. Typed, I get. But strongly typed? Am I mistaken in
thinking there isn't really any type-checking at all? As long as an object
can accept the right messages, it will work, regardless of the context.
That is, if I had a routine with two parameters, "a" and "b", and it
expects both to be an integer:
c := a plus: b
If a and b happen to be strings, this code will still work. Or if they're
ingredients to a recipe or...whatever, as long as they have a "plus"
method.
Is this true? Anyone have opinions on this? I mean, I guess it's just a
label in the long run, but--well, I work a lot with Pascal so strong,
static-typing, compile-time checking is the norm for me.
More information about the Squeak-dev
mailing list
|