As ESUG was so inspiring, I could not resist some VW hacking on the
train home...
If you browse to WideClass and WideClassTest on SCG Store, there is a
simple implementation of wide classes. As we have tons of empty inst
vars in moose models, that might help us to save some megas on large
case studies.
How to use it?
Sending #wide:put: to any object will install an instance var and
accessors on the receiver instance.
o := Object new.
o wide: #foo put: 4.
o foo
and even better, if you implement #foo and #foo: as follows
foo ^nil
foo: arg self wide: #foo put: arg
upon first execution of #foo: the foo inst var is installed and both
methods get properly overriden with simple accessors. There is no DNU
hack anywhere!
Hope you have some fun playing around with it!
cheers,
AA