Reflection would be really nice

Frank Benoit (keinfarbton) benoit at tionex.removethispart.de
Thu Apr 19 01:37:20 PDT 2007


A little hello world in SWT is actually bigger then 7 MB.
This is due to the generated reflection code, and the need to pull in
the whole SWT in the initialization phase.

With rudimentary reflection, this would be much better.

I also think, there would be many application possible with this kind of
stuff.

class ClassInfo{
	Field[] fields;
	Method[] methods;
	Constructors[] constructors;
	static ClassInfo[] allClasses; // probably the most important
}

class Field{
	uint offset;
	TypeInfo type;
	Attribute[] attribs;
	char[] name;
	void* getPtr( Object* obj );
}
class Parameter{
	char[] name;
	TypeInfo type;
	Attribute[] attribs;
}
class Method{
	uint offset;
	TypeInfo ret_type;
	Attribute[] attribs;
	char[] name;
	Parameter[] params;
	void* getPtr( Object* obj = null );
}
class Constructor{
	Attribute[] attribs;
	char[] name;
	void* getPtr();
	Parameter[] params;
}



More information about the Digitalmars-d mailing list