www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 3603] New: Allow selective import syntax to import several modules from a package


           Summary: Allow selective import syntax to import several
                    modules from a package
           Product: D
           Version: future
          Platform: All
        OS/Version: Linux
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: llucax gmail.com

--- Comment #0 from Leandro Lucarella <llucax gmail.com> 2009-12-08 13:49:19
PST ---
Importing a lot of stuff from a deeply nested modules is very annoying because
it needs a lot of repeating, for example:

import really.very.deeply.nested.package.module1;
import really.very.deeply.nested.package.module2;
import really.very.deeply.nested.package.module3;

Allowing selective import syntax to do this in a more concise way would be a
great improvement over this, the above example could be rewritten as:

import really.very.deeply.nested.package: module1, module2, module3;

Maybe this should be semantically equivalent to this instead of the first

import module1 = really.very.deeply.nested.package;
import module2 = really.very.deeply.nested.package;
import module3 = really.very.deeply.nested.package;

It can be a little more consistent with selective imports. But we still have to
same problem if we don't want to type module1.symbol and want to type just
symbol instead.

Maybe a new syntax can be introduced to allow that, like:
import really.very.deeply.nested.package { module1, module2, module3 };

Or something similar.

Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Dec 08 2009