Import proposals (Discuss)

Tom S h3r3tic at remove.mat.uni.torun.pl
Sun Jul 9 18:11:14 PDT 2006


Regan Heath wrote:
> Something that has just occured to me WRT "Part-C" of my idea.. the 
> restriction of allowing only one module is probably un-necessary if we 
> assume a rule;
> 
> * If a module is a single word i.e. "mylib" it comes at the start of an 
> import statement, eg.
> 
>   import mylib;
> 
> or
> 
>   import mylib,my.other.lib.copyFile;
> 
> etc.. and never after a "," eg.
> 
>   import my.other.lib.copyFile,mylib;
> 
> (where "copyFile" is a symbol in "my.other.lib" and "mylib" is not)
> 
> So, this allows multiple modules in the same import statement even 
> allowing you to import them into the same named scope, some examples:
> 
>   import my.other.lib.copyFile,deleteFile,your.lib.moveFile;
> 
> imports "copyFile" and "deleteFile" from "my.other.lib" and "moveFile" 
> from "your.lib".
> 
>   import my.other.lib.copyFile,deleteFile,your.lib.moveFile as file;
> 
> imports "copyFile" and "deleteFile" from "my.other.lib" and "moveFile" 
> from "your.lib" into named scope "file".
> 
> Thoughts?

Sorry, but I don't like it. I bet that every second coder new to the 
language would get totally confused by it.


-- 
Tomasz Stachowiak  /+ a.k.a. h3r3tic +/



More information about the Digitalmars-d mailing list