std.experimental.logger formal review round 3
Robert burner Schadek via Digitalmars-d
digitalmars-d at puremagic.com
Mon Oct 27 01:28:07 PDT 2014
On Sunday, 26 October 2014 at 22:57:51 UTC, Martin Nowak wrote:
> On 10/26/2014 11:27 PM, Robert burner Schadek wrote:
>> it is not really a dependency as the one template that uses
>> the version
>> identifier uses them optionally.
>
> It simply doesn't work, e.g. you could not statically disable
> logging in phobos without recompiling phobos.
>
> cat > lib.d << CODE
> version (StdLoggerDisableLogging)
> enum isLoggingActive = false;
> else
> enum isLoggingActive = true;
>
> void doSome()
> {
> import std.stdio;
> writeln("isLoggingActive: ", isLoggingActive);
> }
> CODE
>
> cat > main.d << CODE
> import lib, std.stdio;
>
> void main()
> {
> writeln("isLoggingActive: ", isLoggingActive);
> doSome();
> }
> CODE
>
> dmd -version=StdLoggerDisableLogging -lib lib.d
> dmd main lib.a
> ./main
If it where done this way, yes of course you're right. But it is
not, please take a look a the source first.
More information about the Digitalmars-d
mailing list