Re: html documentation should show public imports

2013-07-18 Thread H. S. Teoh
On Wed, Jul 17, 2013 at 09:21:08PM -0700, Jonathan M Davis wrote:
 On Wednesday, July 17, 2013 17:39:19 Timothee Cour wrote:
  std.range shouldn't contain public import std.array.
 
 It's done because otherwise std.range is useless with arrays, and
 arrays are probably the most frequently used type of range. We lose
 nothing by having that public import. Now, documenting public imports
 is a good idea, but I don't understand why you think that having
 std.range publicly import std.array is a problem.
[...]

We should document public imports.

But the whole point of publically importing std.array in std.range is so
that you can endow arrays with the range API by importing just
std.range. I think we should keep it. Just add it to the documentation.


T

-- 
Just because you can, doesn't mean you should.


Re: html documentation should show public imports

2013-07-18 Thread Jesse Phillips

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.


Re: html documentation should show public imports

2013-07-17 Thread bearophile

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


Re: html documentation should show public imports

2013-07-17 Thread Jonathan M Davis
On Wednesday, July 17, 2013 17:39:19 Timothee Cour wrote:
 std.range shouldn't contain public import std.array.

It's done because otherwise std.range is useless with arrays, and arrays are 
probably the most frequently used type of range. We lose nothing by having 
that public import. Now, documenting public imports is a good idea, but I 
don't understand why you think that having std.range publicly import std.array 
is a problem.

- Jonathan M Davis