Thread overview
html documentation should show public imports
Jul 18, 2013
Timothee Cour
Jul 18, 2013
bearophile
Jul 18, 2013
Jesse Phillips
July 18, 2013
std.range contains public import std.array.
There are a few full module public imports like that in phobos. What's the
rationale?
I understand for hierarchical modules (breaking modules into packages) but
for this?
it's a bit confusing, as searching for 'array' in std.range docs yields
nothing.

My suggestion:

1)
html documentation should show public imports (sometimes such public
imports make sense)

2)
std.range shouldn't contain public import std.array.


July 18, 2013
Timothee Cour:

> 1)
> html documentation should show public imports (sometimes such public imports make sense)
>
> 2)
> std.range shouldn't contain public import std.array.

Sounds good.

Bye,
bearophile
July 18, 2013
On Thursday, 18 July 2013 at 00:39:33 UTC, Timothee Cour wrote:
> std.range contains public import std.array.
> There are a few full module public imports like that in phobos. What's the
> rationale?
> I understand for hierarchical modules (breaking modules into packages) but
> for this?

I'm pretty sure that std.array is publicly imported since without it an array isn't a range. If your module works on ranges it must support arrays (if your module is template heavy).


string[] myList; ...
std.algorithm.sort(myList);

This would fail if std.array wasn't imported by std.algorithm and there is nothing you'd be able to do about it from outside std.algorithm.