-
-
Notifications
You must be signed in to change notification settings - Fork 609
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow version (assert) like version (unittest). #1099
Conversation
|
That's great, I've also found myself in need for that. There are two other important flags that can't be detected programmatically: release mode and noboundscheck mode. But those are not associated with keywords. Any ideas on how we can address those? I guess the simple thing would be to have the compiler implicitly define appropriately. Thoughts? |
|
I'll preemptively merge this because it's consistent with what we already do and enables doing something that wouldn't be otherwise possible. If core compiler devs you have a strong disagreement please apologize. |
Allow version (assert) like version (unittest).
|
I think that's the most reasonable approach. Preferably Release mode can be detected by doing something like: Though that isn't pretty. But we have the same problem when you want to check for the inverse of some version condition... |
|
Good point, thanks. I think debug/else is reasonable. So D_ArrayBoundChecks is the remaining issue. |
|
debug/else doesn't work. Compiling with no flags isn't debug. dmd -debug (version == debug) |
|
Well, that is certainly a mess. Why doesn't DMD just default to |
|
Because you don't usually want full debug. Full debug adds extra error checking that you don't usually want for general development. |
|
I'm starting to think that this Well, whatever. In any case, I can't help but think that integrating something into the language to detect |
http://forum.dlang.org/thread/cjvqwekzcdauoqutdjwf@forum.dlang.org