Does it make sense to remove slots ?

Todd Fleming todd at flemingcnc.com
Sun Nov 7 14:28:34 PST 2004


Massimo Dentico wrote:

>
>> 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*.


I think we're talking about objects, not values. I'm ok with subtyping 
Ellipse with Circle if users are expected to treat them as immutable 
after they are created.

> 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.

No argument here until I figure out how to mutate the number 2 :)

> 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.

These definitions sound good, so I'll probably use them for now on in 
this forum. The squishing problem still exists whether Circle is a 
subtype of Ellipse or it inherits from Ellipse, except if they are 
treated as immutable.

Todd




More information about the Slate mailing list