On 25 juin 2014, at 17:06, Norbert Hartl <norbert@hartl.name> wrote:


Am 25.06.2014 um 16:55 schrieb Esteban A. Maringolo <emaringolo@gmail.com>:

2014-06-25 11:52 GMT-03:00 Esteban Lorenzano <estebanlm@gmail.com>:

On 25 Jun 2014, at 11:49, Marcus Denker <marcus.denker@inria.fr> wrote:


On 25 Jun 2014, at 16:43, Esteban A. Maringolo <emaringolo@gmail.com> wrote:

Slot
\SimpleSlot (current iv slot)

Yes, the naming of that one� I think we just need to take the freedom of iterating.
For now I called it �InstanceVariableSlot�, but that might be confusing and it is a long word.

but is less confusing than �SimpleSlot�, which basically says nothing, IMO

What about SimpleInstanceVariableSlot? (just kidding)

I don't like over descriptive class names. Because they restrict you
from using it for other, unexpected, purposes or contexts.


The question to me is why this is "over descriptive". We have a tradition here to be descriptive and intention revealing. It happens everywhere except when it comes to instance variables it is instVarAt: instVarNamed: etc. I never liked them. 
Another question might be the usage context. Why is it called InstanceVariableSlot anyway?
Is there a difference if the slot is attached to the instance side or class side?

No indeed there is no difference, an iv slot attached to the class side is still an instance variable slot that happens to be declared in a metaclass and assigned in its unique instance and in its many subinstances. 

Isn't it really just a VariableSlot?

It sounds too generic to me as custom slots can represent other kind of variables like class-variables:

ClassSlot>>read: anObject
^ value
ClassSlot>>write: anObject to: aValue
value := aValue

Note that iv slots are the default kind of slot, so no matter how long it seems to type InstanceVariableSlot, you won't have to type it. 
For example the current class builder can be used like this:
PharoClassInstaller make: [ :builder | builder name: #MyClass; slots: { #a. #b => CustomSlot } ]. 
#a will be a slot of the default kind (currently named Slot) and #b will be a CustomSlot.

The context for the instance is where it is used. Asking an object for instance variables and class instance variables could just return a collection of VariableSlots, no?


Norbert