A)
whether the logic is done in compiler or druntime shouldn't matter to user, so it'd be nice to use as uniform syntax as possible, ie:dmd -version=noboundscheck should be supported (in addition to existing -noboundscheck)
Implementation can then use that version flag to set compiler flag -noboundscheck.
B)
noboundscheck can be used in library code as well for similar bounds checking semantics: for example, checking index bounds inside a user defined opIndex method. Hence distinguishing between compiler flag vs version flag doesn't make that much sense.
C)
It was introduced here:
by @alexrp.
Since it wasn't in any change log, it's recent and makes sense, can we start a deprecation path to have D_NoBoundsChecks => noboundscheck ?
On Mon, Jun 3, 2013 at 5:46 PM, Jonathan M Davis
<jmdavisProg@gmx.com> wrote:
On Monday, June 03, 2013 16:49:29 Timothee Cour wrote:
> I meant 'why not have version(noboundscheck) instead of
> version(D_NoBoundsChecks)'
> of course.
So, you're complaining about the name of the version identifier? I thought that
you were complaining that we were using a flag instead a version identifier to
turn on noboundscheck.
I don't know why that name was chosen or even who chose it. If you look at the
list of official identifiers, you can see that it's pretty arbitrary as to what
the exact naming scheme is. Not even the casing is consistent. So, I expect
that D_NoBoundsCheck was chosen simply because whoever picked it thought that
it best followed the generally naming scheme, or they just preferred that
name. As it stands, there's really no hope of being able to figure out what any
of the official version identifiers are without looking them up and memorizing
them - including the spelling and whatever other naming quirks that particular
identifier may have. And unfortunately, there's no way that that's going to be
fixed at this point due to code breakage that it would cause.
You might be able to get D_NoBoundsChecks changed given how new it is, but I
don't know.
- Jonathan M Davis