version(noboundscheck) + friends

Jonathan M Davis jmdavisProg at gmx.com
Mon Jun 3 20:25:49 PDT 2013


On Tuesday, June 04, 2013 05:17:08 Ivan Kazmenko wrote:
> By the way, what is the naming convention of predefined versions?
>   I am having a hard time trying to figure it out by myself from
> the docs (http://dlang.org/version.html#PredefinedVersions).
> 
> To me, it would make sense if all predefined versions started
> with "D_" or something similar to avoid conflicts with user
> versions.  Currently, the exceptions are vendor-related and
> architecture-related (a whole lot of them, actually) as well as
> the following:
> 
> unittest
> assert
> all
> none
> 
> Now, "all" and "none" are clearly special.  But, really, what's
> the conceptual difference between "unittest", "assert" and
> "D_NoBoundsChecks" which results in using the different naming
> convention?

Sorry. There is no naming convention. It's completely arbitrary. They were 
added haphazardly over time, and AFAIK, there was never any real effort when 
adding them to make them consistent, or if there was, the conventions weren't 
followed consistently throughout, and the end result is that there really is 
no naming convention. And Walter didn't want to change any of them later, 
because that would break code (and potentially do so in silent and nasty 
ways). So, we're stuck with an incredibly inconsistent set of names.

- Jonathan M Davis


More information about the Digitalmars-d-learn mailing list