Alexandre Bergel <alexan...@...> writes:

> Do you manage automatic class removing in the tearDown?

Created classes are not registered with the system, so garbage collection will
 reclaim them when no longer used---unless there is a hidden class cache of
 which I am not aware. I have found a class names cache but not a class cache.

> You propose:
> > class := ClassFactory newSubclass: Point with: [ :f |
> >       f metaSide compile: 'somePoint ^ self x: 2 y: 3'.
> >       f compile: '+ arg ^ self x + arg x ..... 3' ].
> > ].
> 
> I find this difficult to remember.

What is difficult to remember, the API names?

By the way, the rational for using a block is that the class is only built in
 the end. The class cannot be built in the beginnen, since I want to allow the
 addition of instance variables any time while building it. The motivation is
 that clients should be able to loop over some array and add accessors one by 
 one. For example as in

    class := ClassFactory newSubclassWith: [ :f |
        array do: [ :each | f compileAccessorFor: each. ]]
        
which behind the scenes keeps adding new variables to class under construction.
 A future feature might even be initialization support ...

--AA


_______________________________________________
Pharo-project mailing list
Pharo-project@lists.gforge.inria.fr
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project

Reply via email to