std.compress

H. S. Teoh hsteoh at quickfur.ath.cx
Wed Jun 5 12:47:22 PDT 2013


On Wed, Jun 05, 2013 at 03:44:30PM -0400, Andrei Alexandrescu wrote:
> On 6/5/13 3:38 PM, Andrei Alexandrescu wrote:
> >On 6/5/13 2:42 PM, H. S. Teoh wrote:
> >>Is that even necessary? We could just do this:
> >>
> >>----std/algorithm.d----
> >>module std.algorithm;
> >>public import std.algorithm.search;
> >>public import std.algorithm.compare;
> >>public import std.algorithm.iteration;
> >>public import std.algorithm.sort;
> >>public import std.algorithm.set;
> >>public import std.algorithm.mutation;
> >>----snip----
> >
> >For perfect 100% undetectable backwards compatibility:
> >
> >module std.algorithm;
> >private import std.algorithm.search;
> >alias balancedParens = std.algorithm.search.balancedParens;
> >alias boyerMooreFinder = std.algorithm.search.boyerMooreFinder;
> >...
> >
> >
> >Andrei
> 
> Wait, that all doesn't work - there's confusion between the file
> std/algorithm.d file and the std/algorithm/ directory.
[...]

Oh? I thought the compiler would be smart enough to look for
"std/algorithm.d" when you say "import std.algorithm", and to look for
std/algorithm/*.d when there's trailing stuff following "std.algorithm".

Or is this why somebody was suggesting some time ago about importing a
directory being implicitly translated to importing "_.d" in the
directory?


T

-- 
Do not reason with the unreasonable; you lose by definition.


More information about the Digitalmars-d mailing list