Replies: 4 comments
-
I very like an idea of identifiers. Identifiers can hold an information about compiler features, compiler itself or operating system. Moreover I think they should be scoped, for example: |
Beta Was this translation helpful? Give feedback.
-
Yeah, this is on the roadmap as a must-have. First draft prolly just like version(D_OpenD) to pop it out. Since it is global to the compiler, version is actually fairly appropriate. Then also on the list is "killing version" and that's because I don't actually like it: http://dpldocs.info/this-week-in-d/Blog.Posted_2023_10_16.html#version's-problems A better way I think would be to make a module you can import that defines the things as enums and yeah, passing through the command line could be done, i imagine like a magic __trait that gets at the command line one and you use that to set an enum in the config module. |
Beta Was this translation helpful? Give feedback.
-
Added |
Beta Was this translation helpful? Give feedback.
-
Would it be a good idea to have some sort of compile-time defined value that I could use to check if it's being compiled by the forked compiler? e.g., if I wanted my code to use the new string interp, wrapped in a static if.
Or maybe a better idea might be a system of feature-based identifiers that code could use to check what features the compiler supports.
Beta Was this translation helpful? Give feedback.
All reactions