Reducing the inter-dependencies (in Phobos and at large)
Dmitry Olshansky
dmitry.olsh at gmail.com
Wed Apr 24 12:08:21 PDT 2013
24-Apr-2013 19:56, Joshua Niehus пишет:
> On Wednesday, 24 April 2013 at 12:03:52 UTC, Dmitry Olshansky wrote:
>> E.g. std.regex would import std.concept.random to get isUniformRNG and
>> rely on duck typing thusly described to use it correctly.
>> Thoughts? Other ideas?
>
> how would this be different then limited imports such as:
> import std.random: isUniformRNG;
> ?
No matter how it looks to you this line means:
pull in whatever is std.random and make symbol isUniformRNG visible.
Since compiler can't know (well that might improve but not anytime
soon) that isUniformRNG is independent of static ctors/dtors and globals
in that module it has to run both.
Strictly speaking what is required is breaking up modules more meaningfully.
--
Dmitry Olshansky
More information about the Digitalmars-d
mailing list