On Jan 17, 11:06 am, Michael Doubez <michael.dou...@free.fr> wrote:
On 17 jan, 02:10, "Paul" <pchris...@yahoo.co.uk> wrote:
"Michael Doubez" <michael.dou...@free.fr> wrote in message
news:7681fb72-6ac5-41d4-8a33-3d4dc736ca25@f20g2000vbc.googlegroups.com=
geneal public.
Please, get a little more background on the subject before answering
such useless comment; this is very trollish.
As for continuing with =D6=F6 Tib
For prototype-based/class-based languages, "A theory of objects" by
Mart=EDn Abadi and Luca Cardelli note:
<quote>
The main insight of the object-based model is that class-based notions
need not be assumed, but instead can be emulated by more primitive
notions. Moreover, these more primitive notions can be combined in
more flexible ways than a strict class discipline.[....]
</quote>
This backs my claim that that you cannot do without class (as I
understand it) but my defintion must be broader than generally
accepted since it is clearly defined as a language without class.
Yes, perhaps you imagine classes differently than on common case.
Commonly a class is fixed template. A type that is sort of self-
contained and does not change for particular object. There are
inheritance hierarchies of classes to gain some flexibility with fixed
set of "reasonable" combinations. On most cases it is good enough.
The prototypes are more flexible than classes. Objects can gain and
change their abilities and attributes during their life-time. Objects
interfaces (and amount of available interfaces) may change
dynamically. That makes prototype-based objects more life-like. More
flexibility may make it more complex, but like your book say that
class-like behavior may be always emulated where it is good enough.
For simple example ... a door. It does not make sense to lock (or
unlock) it when it lacks locks. Either there is always an interface
that does not make sense for all doors or ... if it initially did not
have locks then you have to "destroy" the lockless door and
"construct" new one with lock to add a lock to door.
Ok. I stand corrected.