"bearophile" <[email protected]> wrote in message news:[email protected]... > Nick Sabalausky: > >> The goal of this challenge is to define a global-level manifest constant >> enum that holds a value that has been incremented from multiple modules: > > And I hope people will try to solve it! > So if someone solves it, we can later patch that bug ;-) >
FWIW, The original motivation for this was that I was reading the recent "Improving version(...)" thread and thought "isVersion" was a notable improvement, but still didn't solve the problem that version identifiers don't have to be pre-defined and are therefore subject to bugs from typos. I wondered if an acceptable library-based solution could be done and started tinkering with it, but quickly realized it would most likely need mutable global compile-time state which D doesn't have a direct mechanism for. The only way to trigger CTFE seems to be by creating a value that's immutable even at compile-time (ex: enum x = ctfeFunc()). And trying to do it with template or mixin trickery leads to seemingly insurmountable scope-related problems.
