1. It adds yet another layer of indirection that is not explicitly
integrated into the class hierarchy, making it
tough to sort out what is going on.
2. There is the problem of collisions with the message name space of Object.
3. Keeping everything in Environments and doing the layering with
'parent' (rather than using a class wrapper)
is more transparent. It also makes it possible to alter things for
a specific project without having to change the class
library.
Alberto's GUI class demonstrates the advantages of using environment
prototypes: it allows you to stick to standard
coding style, so it is very easy to migrate existing work into a new
framework.
GUIEvent and ConductorGUI demonstrates making the environment lookup explicit.
If requires yet another paradigm (Event style coding) for the GUI.
But it integrates the 'skin'
with the GUI library and should be easier to extend.
RJK
On Aug 2, 2006, at 10:40 AM, Julian Rohrhuber wrote:
or, make a subclass of event that redefines put if you want to
keep maximum speed.
this means that ~tilde is not safe and also not
(a: { myfunc }) style.
another way to do it is:
prototype {
var coll = this.methodCollisions;
^if(coll.isNil) {
this
} {
"This % cannot be used as prototype, because
the following methods "
"are already defined in its class definition:
%\n".postf(this.class, coll);
nil
}
}
methodCollisions { arg coll;
this.keysDo { |key| if(this.class.respondsTo(key)) {
coll = coll.add(key) } };
proto !? { coll = proto. methodCollisions(coll) };
parent !? { coll = parent. methodCollisions(coll) };
^coll
}
Then you just call
.prototype when you want to be sure.
--
.
_______________________________________________
sc-dev mailing list
sc-dev@xxxxxxxxxxxxxxx
http://www.create.ucsb.edu/mailman/listinfo/sc-dev
_______________________________________________
sc-dev mailing list
sc-dev@xxxxxxxxxxxxxxx
http://www.create.ucsb.edu/mailman/listinfo/sc-dev