Please test: black holes and white holes

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Tue May 19 00:50:20 PDT 2009


Shin Fujishiro wrote:
> I've implemented two templates: defineBlackHole and defineWhiteHole.
> Given a class or interface C, they generate a declaration of a new class
> which automatically implements all abstract methods defined in C and its
> ancestors.
> 
> They seems to be working fine (dmd 2.030). Could you please test them?
> And should they be added to Phobos?
> 
> These patches have to be applied to Phobos:
> http://d.puremagic.com/issues/show_bug.cgi?id=2989
> http://d.puremagic.com/issues/show_bug.cgi?id=2996
> 
> Code:
> http://code.google.com/p/kabe/source/browse/branches/bhwh/test.d
> http://code.google.com/p/kabe/source/browse/branches/bhwh/nonstd/traits.d
> http://code.google.com/p/kabe/source/browse/branches/bhwh/nonstd/typecons.d

The code looks very clean and well-written. Great job.

One question - has anything prevented you from writing a shell class?

class BlackHole(C)
{
     mixin(generateBlackHoleCode(C.stringof));
}

?

It's a tad more comfortable to just say BlackHole!C instead of 
generating it separately.


Andrei


More information about the Digitalmars-d-announce mailing list