www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 3504] New: [module] import foo: *; should be supported if imports are static by default

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=3504

           Summary: [module] import foo: *; should be supported if imports
                    are static by default
           Product: D
           Version: future
          Platform: Other
        OS/Version: All
            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-11-13 16:24:03
PST ---
This is complementary to bug 3503 (make imports static by default). If that is
the case, it would be a good idea to provide a way to have the old behavior,
since it can be useful for a small set of applications (like small scripts).

A proposed syntax could be:

import foo: *;

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Nov 13 2009
parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=3504



--- Comment #1 from Leandro Lucarella <llucax gmail.com> 2009-11-14 09:39:42
PST ---
Here is an example on how this should work with modules and packages:

mod.d:
        void f() {}

pkg/a.d:
        void f() {}

pkg/pkg.d:
        void f() {}

x.d:
        import mod: *;
        import pkg: *;

        void main() {
                f();     // mod.f
                a.f();   // pkg.a.f
                pkg.f(); // pkg.pkg.f
        }

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