Import proposals (Discuss)
Ameer Armaly
ameer_armaly at hotmail.com
Sun Jul 9 18:53:02 PDT 2006
"Regan Heath" <regan at netwin.co.nz> wrote in message
news:optcf7kzem23k2f5 at nrage...
> 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?
>
IMO it's a bit confusing, and I can't see very many cases where it's
particularly useful, but that could just be me.
> Regan
More information about the Digitalmars-d
mailing list