Hi,

One of the power of slots is the concept of Virtual Slots that do not have an 
ivar to store their state.
But of course, some uses fo this concept want to store state in the object.
(e.g. imagine a property slot, all proper slots of the object would store into 
a property dictionary).

The idea is that one can add iVars reflectively that are hidden from both 
introspection *and* the class
definition. (the inspector should get  a view to see reality, of course, 
similar to how we tread Dictionaries and OrderedCollection:
The “basic” view is not relavant in most cases, it is just available in 
addition, the default is the high level view that is closer
to the “mental model” of the programmer).

https://pharo.fogbugz.com/f/cases/14786/Slots-add-HiddenInstanceVariableSlot-and-rename-AbstractInstanceVariableSlot-to-IndexedSlot
 
<https://pharo.fogbugz.com/f/cases/14786/Slots-add-HiddenInstanceVariableSlot-and-rename-AbstractInstanceVariableSlot-to-IndexedSlot>

-> Add a sublass of normal invar slots that is hidden 
-> change #slots of Behavior to return #allVisibleSlots

Next: When building classes with Slots, the class builder need to call back on 
the slot and hand the class to each. Then the slot
can reflectively change the class, e.g. the PropertySlot will check if there is 
already a hidden property base slot and if not, add it
reflectively).

        Marcus

Reply via email to