On 09/06/2010 11:46 AM, Holger Hans Peter Freyther wrote:
On 09/06/2010 04:30 PM, Paolo Bonzini wrote:
It's a bit ugly, but not strictly a bug. I suggest you use a
dictionary, and #doesNotUnderstand: instead of a getter, especially
because you're adding the instance variables to _all_ instances of
LogConfig rather than just one.
Two more questions
1.) is it possible to only add instance variables only to one instance? How
would I do it? '123' addInstVarNamed didn't work here.
You need to create a "lightweight class", like
| cl |
cl := Behavior new.
cl superclass: instance class.
instance changeClassTo: cl.
cl addInstVarNamed: 'a'.
However, it's broken and only works if "instance class" has no instance
variables at all. I'll shortly push a fix.
2.) #doesNotUnderstand will not work from what I see as the Logging Module
does not know who is going to add areas to it, unless I do something like
LogConfig allSubClassesDo: []... is that appropriate?
I don't understand why would you subclass LogConfig rather than create
multiple instances?
Paolo
_______________________________________________
help-smalltalk mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/help-smalltalk