Named multi-imports

jmh530 via Digitalmars-d digitalmars-d at
Wed Aug 16 10:14:49 PDT 2017

On Wednesday, 16 August 2017 at 14:42:51 UTC, Mike Wey wrote:
> Wouldn't that just move the problem?
> You then get an package that imports gtk.Window and a other 
> package that imports gdk.Window, and if you want to use both 
> you still need to add a renamed import or a static import in 
> your own file.

I don't know anything about gtkd, but I think he means something 
like below.

module gtkd;
public import gtk;
public import gdk;

module gtk;
public import gtk.Window;

module gdk;
public import gdk.Window;

So you should then be able to do something like
import gtkd : functionThatDoesntOverlap;
import gtk = gtkd.gtk : functionThatDoesOverlap;
import gdk = gtkd.gdk : functionThatDoesOverlap;

A longer-term solution is for something like
import gtkd;
to only pull in the functions/structs/classes/etc that are 
actually used.

More information about the Digitalmars-d mailing list