> On 11 Sep 2015, at 20:05, Hernán Morales Durand <hernan.mora...@gmail.com> 
> wrote:
> 
> 
> I saw some interesting reflection progress in Pharo 5. I wonder if there is a 
> feature to rank instance variables. For example, from the browser I want to 
> assign a category "important" to an instance variable, or "possibly useless", 
> etc. for later refactorings.
> 
> Is such thing "easily" possible now? There is API support from Reflectivity 
> maybe?
> 

The infrastructure is there… we can annotate instance variables.

(Point slotNamed: #x) propertyAt: #note put: 'useless'.
(Point slotNamed: #x) propertyAt: #note

One could build a user interface around that.

Properties are not saved with monticello, though. They are like method 
properties. So one would
need to build something on top...

Another idea would be to make a subclass of InstanceVariableSlot that stores 
the note in a property but
it is actually part of the slot definition:

Object subclass: #Point
        slots: { #x => InstanceVariableWithNote note: ’this is useless’. 
                   #y }
        classVariables: {  }
        category: 'Kernel-BasicObjects'

As the note is part of the slot definition, it would be saved in Monticello.


(unrelated: I still am tempted to just use the term “instance variable” and get 
rid of the term Slot.. for the paper is was nice, but now? Especially
as we have slot like first class ClassVars and Globals that nevertheless are 
not slots…)

        Marcus



Reply via email to