www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - public imports

reply Thorsten Kiefer <thorstenkiefer gmx.de> writes:
Hi,
is it possible that if I import a module,then I import that module's imports
also ?
E.g.:

// test.d
module test;
import std.stdio;

//main.d
import test;
...writefln...
Mar 04 2007
next sibling parent Max Samukha <samukha voliacable.com> writes:
On Sun, 04 Mar 2007 16:10:55 -0500, Thorsten Kiefer
<thorstenkiefer gmx.de> wrote:

Hi,
is it possible that if I import a module,then I import that module's imports
also ?
E.g.:

// test.d
module test;
import std.stdio;

//main.d
import test;
...writefln...

// test.d module test; public import std.stdio; //main.d import test; ...writefln...
Mar 04 2007
prev sibling parent reply Frits van Bommel <fvbommel REMwOVExCAPSs.nl> writes:
Thorsten Kiefer wrote:
 Hi,
 is it possible that if I import a module,then I import that module's imports
also ?
 E.g.:
 
 // test.d
 module test;
 import std.stdio;
 
 //main.d
 import test;
 ...writefln...

Ahem.. it's practically in the subject line: "public import std.stdio;" :)
Mar 04 2007
parent =?ISO-8859-1?Q?Anders_F_Bj=F6rklund?= <afb algonet.se> writes:
Frits van Bommel wrote:

 is it possible that if I import a module,then I import that module's 
 imports also ?

Ahem.. it's practically in the subject line: "public import std.stdio;" :)

Also if you find/read old D code, be aware that the default option for imports changed from "public" over to "private" with DMD 0.163... http://www.digitalmars.com/d/changelog2.html#new0163 --anders
Mar 04 2007