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

Re: Curl, multiple inheritance, and interfaces (was Re: cheerful static typing)

 "Anton van Straaten" <anton@appsolutions.com> wrote:
> If you're suggesting that simply because a class happens to include methods
> that match a particular interface, that it should satisfy that interface, I
> don't think that's a very good idea.  It is what Smalltalk-like languages
> effectively do, though, but that's only because they're not being explicit
> about interfaces at all, and because they only support single inheritance so
> are forced to "cheat" to support multiple interfaces on an object.

When I switched to programming in Python instead of C++ and Java, I learned this 
style of interfaces, and quickly grew to love it.  I can't speak for the 
designers of Smalltalk, but if I design my own programming language, it will
definitely include this style of dynamic, structural typing as a feature -- not 
as a work-around for some other inadequacy.  ;-)

The same notion of structural typing can be implemented with static typing, if 
you like.



Security and Distributed Systems Engineering