Hi Everyone,I've been poking the runtime some more. Attached, you will find a libobjc patch which adds support for different message lookup mechanisms. Unlike the last patch, this one has actually been tested (and has had its behaviour slightly modified based on experimental use).
Also attached is a basic implementation of prototypes. This allows you to do things like:
id anObject;
DEFMETHOD(method)
{
//Code goes here.
}
[anObject setMethod:(IMP)method forSelector:@selector(foo)];
[anObject foo];
The .m file contains the Prototype class, which supports this
behaviour and a simple program demonstrating it. Implementing this
for NSObject would be possible, but would have a runtime penalty for
all objects.
I am not 100% convinced this is useful; I mainly wrote it to test my libobjc modification so Quentin can see if bugs in the new Io bridge are his fault or mine easily (and as a displacement activity to avoid thinking about my interview on Monday). If it actually is useful, then let me know and I'll add it to svn.
David
prototype.m
Description: Binary data
libobjc.diff
Description: Binary data
_______________________________________________ Etoile-dev mailing list [email protected] https://mail.gna.org/listinfo/etoile-dev
