Spurious imports in Phobos ?

2011-11-09 Thread Somedude
Hello, When I display the dependencies with "dmd -deps=depends", I see that simply importing std.stdio imports dozens of modules, among which std.ranges, std.datetime, std.c.windows.winsock, std.regex, etc In fact, the depends file is 433 lines long. I noticed that std.string imports quite a lot

Re: Spurious imports in Phobos ?

2011-11-09 Thread Somedude
Le 09/11/2011 10:14, Somedude a écrit : > > My question is: how do we know if std.range, std.regex, std.traits and > std.algorithm are spurious imports or if we can (and threfore should) > remove them safely from std.string ? > > Dude I meant: how do we know if std.range, std.regex, std.traits

Re: Spurious imports in Phobos ?

2011-11-09 Thread Jacob Carlborg
On 2011-11-09 10:14, Somedude wrote: Hello, When I display the dependencies with "dmd -deps=depends", I see that simply importing std.stdio imports dozens of modules, among which std.ranges, std.datetime, std.c.windows.winsock, std.regex, etc In fact, the depends file is 433 lines long. I notic

Re: Spurious imports in Phobos ?

2011-11-09 Thread Somedude
Le 09/11/2011 13:15, Jacob Carlborg a écrit : Phobos contains a lot of templates and if a template isn't instantiated it won't be compiled. Meaning there can be hidden compile errors if you start to remove imports and they will not show until a template that uses something from the import is inst

Re: Spurious imports in Phobos ?

2011-11-09 Thread Trass3r
2. what is your opinion about public import ? In C++, "hidden" or "implicit" #includes is a common source of compilation problems (order of #includes), I tend to think it's a bad thing. It can be quite useful. I use it often for C library wrappers. As soon as you import the wrapper code you

Re: Spurious imports in Phobos ?

2011-11-09 Thread Trass3r
Phobos contains a lot of templates and if a template isn't instantiated it won't be compiled. Meaning there can be hidden compile errors if you start to remove imports and they will not show until a template that uses something from the import is instantiate. Wouldn't it be possible/better

Re: Spurious imports in Phobos ?

2011-11-09 Thread Jacob Carlborg
On 2011-11-09 14:16, Trass3r wrote: Phobos contains a lot of templates and if a template isn't instantiated it won't be compiled. Meaning there can be hidden compile errors if you start to remove imports and they will not show until a template that uses something from the import is instantiate.

Re: Spurious imports in Phobos ?

2011-11-09 Thread Jacob Carlborg
On 2011-11-09 13:45, Somedude wrote: Le 09/11/2011 13:15, Jacob Carlborg a écrit : Phobos contains a lot of templates and if a template isn't instantiated it won't be compiled. Meaning there can be hidden compile errors if you start to remove imports and they will not show until a template that

Re: Spurious imports in Phobos ?

2011-11-09 Thread Jonathan M Davis
On Wednesday, November 09, 2011 05:42 Jacob Carlborg wrote: > On 2011-11-09 14:16, Trass3r wrote: > >> Phobos contains a lot of templates and if a template isn't > >> instantiated it won't be compiled. Meaning there can be hidden compile > >> errors if you start to remove imports and they will not

Re: Spurious imports in Phobos ?

2011-11-09 Thread Jacob Carlborg
On 2011-11-09 19:14, Jonathan M Davis wrote: On Wednesday, November 09, 2011 05:42 Jacob Carlborg wrote: On 2011-11-09 14:16, Trass3r wrote: Phobos contains a lot of templates and if a template isn't instantiated it won't be compiled. Meaning there can be hidden compile errors if you start to r

Re: Spurious imports in Phobos ?

2011-11-10 Thread Somedude
Le 09/11/2011 14:15, Trass3r a écrit : 2. what is your opinion about public import ? In C++, "hidden" or "implicit" #includes is a common source of compilation problems (order of #includes), I tend to think it's a bad thing. It can be quite useful. I use it often for C library wrappers. As soon

Re: Spurious imports in Phobos ?

2011-11-10 Thread Somedude
Le 09/11/2011 14:50, Jacob Carlborg a écrit : 2. what is your opinion about public import ? In C++, "hidden" or "implicit" #includes is a common source of compilation problems (order of #includes), I tend to think it's a bad thing. Sometimes public imports are useful. It's possible to emulate