[Issue 3603] New: Allow selective import syntax to import several modules from a package

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Dec 8 13:49:20 PST 2009


http://d.puremagic.com/issues/show_bug.cgi?id=3603

           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 at puremagic.com
        ReportedBy: llucax at gmail.com


--- Comment #0 from Leandro Lucarella <llucax at 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
example:

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: -------


More information about the Digitalmars-d-bugs mailing list