www.digitalmars.com         C & C++   DMDScript  

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

reply d-bugmail puremagic.com writes:
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 puremagic.com
        ReportedBy: llucax gmail.com



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: -------
Dec 08 2009
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=3603


Manu <turkeyman gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |turkeyman gmail.com



Massive +1 from me! (only 3 years later)

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Oct 15 2012
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=3603


Nick Treleaven <ntrel-public yahoo.co.uk> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |ntrel-public yahoo.co.uk



08:55:04 PST ---
 import really.very.deeply.nested.package: module1, module2, module3;
I think this is the way to go, and is very commonly useful.
 import really.very.deeply.nested.package { module1, module2, module3 };
I don't think it's worth allowing both selective modules and selective symbols in the same statement. Importing selective symbols from a module can just use a separate statement, and it's less common than full module imports anyway. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Jan 23 2013
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=3603


bearophile_hugs eml.cc changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |bearophile_hugs eml.cc



I'd like to write:

import std: stdio, algorithm, range, array;

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jan 24 2013