Browse thread
Smells like duck-typing
[
Home
]
[ Index:
by date
|
by threads
]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
| Date: | -- (:) |
| From: | Robert Fischer <robert@f...> |
| Subject: | Re: [Caml-list] Smells like duck-typing |
> But that never happens with mutators because you cannot > HAVE any additional invariants. The derived type has > to have exactly the same set of values as the base, > in which case you cannot have any new interesting > methods -- any method you have can always be defined > in terms of the characteristic methods already in > the base (assuming the whole public state is accessible > of course). > This is why you 1) define a base class which has a very loose set of invariants or 2) obscure state from inheriting classes. ~~ Robert.