www.digitalmars.com         C & C++   DMDScript  

D - Some Features for D

Hallo NG,

could classes automatically have all constructors of their super class?


class A
	this(int a,b,c,d,e,f,g,h,i,k,l,m,n,o) { foo();}


class B: A


class B should have the same constructor that A already has.
The documentation says:

If there is no constructor for a class, but there is a constructor for 
the base class, a default constructor of the form:

	this() { }

is implicitly generated.

There should also be a keyword which hides functions in _derived_ 
classes. This would be something between class and interface.

Another thing I already asked about are property functions like Object 
Pascal has them:

class PF
	int prop = 0 read GetProp write SetProp;

	int GetProp() {return prop;}
	void SetProp(int value) { if (value > 7) {prop = value;} else 			{throw 

Do I have to write my own factory to dynamically create a class?
I would like to do somethink like:

Object = CreateClass("Something");

Does the D-language already have somethink like that?
If D does not yet have it, could it be implemented inside the garbage 
collector? The GC already knows about all classes. This could be one 
more reason to use a GC.

I hope you like some of my proposals.

CU Stephan
Apr 27 2003