Import proposals (Discuss)

Regan Heath regan at netwin.co.nz
Sun Jul 9 17:56:49 PDT 2006


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?

Regan



More information about the Digitalmars-d mailing list