New thing I learned for the day

Steven Schveighoffer schveiguy at
Tue Nov 26 15:50:47 UTC 2019

On 11/26/19 10:35 AM, Adam D. Ruppe wrote:
> On Tuesday, 26 November 2019 at 15:28:38 UTC, Steven Schveighoffer wrote:
>> Did you know this was valid syntax? I didn't.
> I did not know already, but it is no surprise to me either because the 
> colon works on almost every other attribute like that too... static if 
> and version are similar according to teh grammar.

static if and version are not attributes. But actually, I didn't know 
that it works with version as well. Seems to also work with a debug 
condition according to grammar.

What's weird is that it doesn't work in a function, but I guess those 
are considered a different part of the grammar.  In any case, I probably 
will not be using it. But I did a double take when I saw it...


More information about the Digitalmars-d mailing list