[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: dynamic vs. static typing



Mike Vanier wrote:
> I recall something Alan Kay once wrote, saying that a possibly 
> useful addition to Smalltalk might be a way of checking "protocols" 
> in advance (I'm paraphrasing).  In other words, it would be nice 
> to check that a given object which is an argument to a method 
> supports a particular protocol (set of messages it can respond 
> to) regardless of what the specific class of the object is.  
> This sounds great in principle, but in Smalltalk, at least, I
> can see problems because it's possible to alter the protocol of 
> a class at any time by deleting methods.  But if you could 
> annotate classes with a set of messages that they guaranteed 
> that they supported (i.e. a protocol), perhaps it could be done.  
> This reminds me of the interface concept in java, which has 
> proven to be amazingly useful in that language.  Have any
> dynamic typing enthusiasts thought of adding such a feature 
> to their languages?

Smallscript has interfaces:
http://www.ai.mit.edu/~gregs/ll1-discuss-archive-html/msg01306.html

So do some Smalltalks, now:
http://wiki.cs.uiuc.edu/VisualWorks/SmallInterfaces