| www.delorie.com/gnu/docs/libobjects/libobjects_50.html | search |
![]() Buy GNU books! | |
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
I would greatly appreciate your feedback on the questions below. Please email your thoughts to mccallum@gnu.ai.mit.edu.
Here's an idea: Define the ...Object methods as macros. But we need a new macro scheme that works for methods instead of functions. We would need something with the following functionality:
#define [REC replaceObject: OLDOBJ with: NEWOBJ] \
([REC replaceElement:(elt)(OLDOBJ) with:(elt)(NEWOBJ)].id_u)
|
It might be good to use something like this (from the gcc PROJECTS file):
* A way of defining a structure containing a union, in which the choice
of union alternative is controlled by a previous structure component.
Here is a possible syntax for this.
struct foo {
enum { INT, DOUBLE } code;
auto union { case INT: int i; case DOUBLE: double d;} value : code;
};
|
This has the disadvantage that now elt's will take up more than one word.
What I would prefer is something more radical: Some efficient way to enable int's, float's to receive Objective-C messages. Then I wouldn't have to worry about any of these horrible elt typing issues; I wouldn't have to worry about all the ...Object ...Element method name duplication; I wouldn't have to worry about the inefficiency of having all the ...Object methods just be covers for the ...Element methods. Lots of other Objective-C code would find this useful too. It has the advantage of fixing the previous question also (about removing the ...Element ...Object method duplication). We need Objective-C objects that can live on the stack.
For now, I've worked out a ObjC++ solution to this with constructors and casting operators. Now I'm just waiting for Kresten to finish ObjC++.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
| webmaster donations bookstore | delorie software privacy |
| Copyright © 2003 by The Free Software Foundation | Updated Jun 2003 |