Typed Systems, Type Inference, etc
Diego Gomez Deck
DiegoGomezDeck at ConsultAr.com
Sat Jul 20 19:22:57 UTC 2002
Hi guys,
Smalltalk allow to write code with the minor possible coupling. An object
is coupled with other object only with the messages sent.
Point>>+ otherPoint
^(self x + otherPoint x) @ (self y + otherPoint y)
The only requirement for otherPoint is to answer #x and #y messages [*].
[*] Answer a message don't means implement a method. Example: a object
using #doesNotUnderstand: can answer to several messages without a method.
Let's see the StrongTalk implementation:
Point>>+ other <Point> ^<Point>
^(self x + other x)@(self y + other y)
Why this method require a "complete" Point? In the not typed version, the
requirements is more relaxed.
This is the problem with typed systems. The objects produced don't grow in
ways don't predicted by the writer.
I think that some type of type annotations helps in the understanding of a
system and I see the problem with type inference.
My proposal is: Let's use Type Feedback to document a System.
Cheers,
Diego Gomez Deck
More information about the Squeak-dev
mailing list
|