Well, the problem in my opinion is, that a square is a rectangle, indeed. However, this is not square is-a rectangle;, but rather: square is-a rectangle with rectangle.height == rectangle.width;
This is overall something I have been pondering (and recently planning and implementing) to extend the standard object orientation: adjectives (opposed to 'nouns' (objects) and 'verbs' (methods)).
An adjective would simply describe a noun furhter and simplify a dispatch inside a method depending on the state of an object.
Some pseudosyntax from the current state of ideas would go like this:
This goes pretty deep if one starts to think about it:
* Buffers: empty, full, something in between
* Abstract syntax trees: well-typed, ill-typed
* Accounts: banned, active, moderator, admin
Have you ever used a language that makes heavy use of pattern matching? Prolog, in particular, or to a lesser extent (due to increasing amounts of distraction by other novel features) Erlang, OCaml/SML, or Haskell. It sounds like you're essentially describing functional dispatch based on structural attributes or current characteristics, rather than a (generally fixed) object identity.
This is overall something I have been pondering (and recently planning and implementing) to extend the standard object orientation: adjectives (opposed to 'nouns' (objects) and 'verbs' (methods)).
An adjective would simply describe a noun furhter and simplify a dispatch inside a method depending on the state of an object.
Some pseudosyntax from the current state of ideas would go like this:
This goes pretty deep if one starts to think about it: * Buffers: empty, full, something in between * Abstract syntax trees: well-typed, ill-typed * Accounts: banned, active, moderator, adminBasically, it simplifies the pattern
I am just currently working on a dispatch mechanism which is at least a bit intuitive :)