On 22 Nov 2007, at 1:25 , Toon Verwaest wrote:
Instead of
E1 >> attr
^ attr
E1 >> attr: anObject
^ attr := anObject
you as base programmer will write
E1 >> attr
^self wideVarAt: #attr ifAbsentr: [ nil ]
E1 >> attr: anObject
self wideVarAt: #attr put: anObject
Can't you just collect all such getters and seters and replace them by
the widevar version at compilation time or something (or run some
optimization over a set of compiled classes), as such that the "base
programmers" don't have to worry about it? Should be quite easy to
just detect getters and setters?
Same as for the dictionary example below, it is requieres human
decision to decide which attributes should be implemented as instvar,
which using a dictionary and which using wide classes/dynamic
instvars or collective state. The compiler can and should not take
such decisions.
AA