Does it make sense to remove slots ?
Massimo Dentico
m.dentico at virgilio.it
Sun Nov 7 15:44:16 PST 2004
"Tim Moore" <Timothy at Moore.name> wrote:
>
> I don't know about "sacred dogma" but I would say that it is generally
> a good idea.
On what ground do you accept this "principle"? How *behavioral* equivalence
is relevant in this case where you clearly want subtyping, ie. you want
to constraint a slot *value* to be in a well defined subset? (My assumption
is that this is what Pupeno want: Pupeno, please, correct me if I'm wrong).
>>> Long story short: Todd is right. Circle shouldn't be derived from
>>> Ellipse unless they're both immutable, and most likely you don't
>>> really need a Circle type at all.
^^^^^^^^^^^
>> Please, explain what does it mean to mutate a *value*.
>>
>> A *value* is immutable by definition; what you can mutate
>> eventually is a *variable*. In the context of a prototype-based
>> languages as Slate, slots are variables.
>
> I'm sorry, but I don't really understand what you're getting at. What
> I'm saying is that if Circle and Ellipse are immutable (i.e., the slots
> don't change after construction and the whole object acts as a
> conceptual value) then there are no problems. However if you do allow
> the axis lengths to change (i.e., the classes function as variables)
> then you can run into problems.
I'm saying that until a clear definition of what to mean
for a prototype to be "a type" and, in this context, of
what "derivedFrom:" means, confusion is granted.
>> Besides this, I agree with Peter van Rooijen: if you decouple
>> the concept of inheritance/subclassing from that of subtyping
>> (IIRC as in Sather http://www.icsi.berkeley.edu/~sather/) the
>> problems vanishes:
>>
>> - subtyping means: if A is a subtype of B, then A is a subset of B;
>> - inheriting means: if A inherit from B, then part/all of the structure
>> and/or behavior of B is *included* in (inherited
>> by) A.
>
> How would that apply here?
I was commenting Peter here. How this apply to Slate depends from
how you set the preceding definitions.
Regards.
P.S.: I hope that my English is understandable here.
--
Massimo Dentico
More information about the Slate
mailing list