Scott Meyers' DConf 2014 keynote "The Last Thing D Needs"

Steven Schveighoffer via Digitalmars-d-announce digitalmars-d-announce at puremagic.com
Thu May 29 12:34:23 PDT 2014


On Thu, 29 May 2014 15:24:06 -0400, Dmitry Olshansky  
<dmitry.olsh at gmail.com> wrote:

> Let it be just a declaration, as simple as that. Attributes affect other  
> declarations in the scope, static if doesn't.

Sure it does:

private:
    int a;
    int b;

equivalent to

private int a;
private int b;

static if(x):
    int a;
    int b;

equivalent to

static if(x) int a;
static if(x) int b;

;)

Yes, I agree static if does not fit the understood meaning of an  
attribute. And it can apply to statements too, whereas attributes can only  
apply to declarations (right?).

In reality, static if is in a league with version and debug, and they  
share similarities to both statements and attributes.

-Steve


More information about the Digitalmars-d-announce mailing list