[Issue 13605] Add ability to `version` a module declaration
via Digitalmars-d-bugs
digitalmars-d-bugs at puremagic.com
Sun Oct 12 20:01:38 PDT 2014
https://issues.dlang.org/show_bug.cgi?id=13605
--- Comment #5 from Mike <slavo5150 at yahoo.com> ---
(In reply to Ketmar Dark from comment #3)
> (In reply to Mike from comment #2)
> > (In reply to Ketmar Dark from comment #1)
> > > what to do with this code:
> > >
> > > version(Posix) module mod;
> > > int n;
> > >
> > > should it be rejected, should compiler build default module name (as it does
> > > now), or something else?
> >
> > What does the compiler do now if the module declaration is missing? This
> > enhancement shouldn't change anything.
> ah, and here we got incinsistency!
>
> the logic and common sense tells me that `version(Posix) module mod;` should
> omit the whole module on on-posix systems.
Programmers who understand the grammar of the language will have no problem
here. There's no reason to think modules declarations are special, and
therefore no inconsistency or ambiguity.
--
More information about the Digitalmars-d-bugs
mailing list