Does D have too many features?

Jonathan M Davis jmdavisProg at gmx.com
Sun Apr 29 20:34:02 PDT 2012


On Monday, April 30, 2012 05:20:21 Alex Rønne Petersen wrote:
> Except we can't do:
> 
> @test
> void myTest()
> {
>      // ...
> }
> 
> due to the current lack of annotations and discovery-based reflection. ;)
> 
> *hint hint...*

What would that buy you? That's what unittest blocks are for. Yes, getting 
custom annotations would be great, and then you could use @test for whatever 
you need it for, but unittest blocks are the test functions, so I'm not quite 
sure what @test would buy you. You _could_ just put a particular string in a 
name though (e.g. start all unit test functions with test) and use compile-
time reflection to find them if you really want to though (much as that isn't as 
nice as a user-defined attribute would be).

- Jonathan M Davis


More information about the Digitalmars-d mailing list