import syntax

BCS BCS at pathlink.com
Mon Jul 3 09:56:15 PDT 2006


Karl Bochert wrote:
> Is there some reason why the syntax is 
> import std.c.stdio
> Rather than 
> import std\c\stdio
> 
> The dot syntax prevents the use of relative paths to modules ( I'm guessing -- I
> haven't actually tried 'import ......foo;' )
> 
> Are relative paths considered bad for imports?
> Is this just an unfortunate side-effect of a syntax that has other advantages?
> 
> I guess the work-around is to use the -I compiler switch which seems like a
> terrible approach to me, moving information that should be in the source to the
> makefile.
> 

actually the better solution is to run DMD with its current directory 
set to the root. If that is more than one location, in all likelihood, 
all but one of the roots are librarys and thus should be pointed to by 
-I anyway



More information about the Digitalmars-d-learn mailing list