So I'm getting sick of this in my files:<div><br></div><div><div>module stache.states.ingamestate;</div><div><br></div><div>import fuji.filesystem;</div><div>import fuji.render;</div><div>import fuji.matrix;</div><div>
import fuji.material;</div><div>import fuji.primitive;</div><div>import fuji.system;</div><div>import fuji.font;</div><div><br></div><div>import std.xml;</div><div>import std.string;</div><div>import std.conv;</div><div>import std.random;</div>
<div>import std.algorithm;</div><div><br></div><div>import stache.battlecamera;</div><div><br></div><div>import stache.i.statemachine;</div><div>import stache.game;</div><div><br></div><div>import stache.util.eventtypes;</div>
<div><br></div><div>import stache.i.entity;</div><div>import stache.entity.combatant;</div><div>import stache.entity.paimei;</div><div><br></div><div>import stache.thinkers.localplayer;</div><div>import stache.thinkers.nullthinker;</div>
<div><br></div><div>import stache.i.collider;</div><div><br></div><div>import stache.sound.soundset;</div><div>import stache.sound.music;</div></div><div><br></div><div><br></div><div>This is obviously silly.</div><div>I know this could be improved with some care, more liberal public imports (dangerous, you risk ending up with EVERYTHING as public import if it sticks as a standard convention), better maintained dependencies... but it's not realistic in a production environment. That sort of maintenance just never happens.</div>
<div><br></div><div>I suggest expanding the selective import mechanism to extend to modules, not just functions within a module, eg:</div><div><br></div><div><div>module stache.states.ingamestate;</div><div><br></div><div>
import fuji: filesystem, render, matrix, material, primitive, system, font;</div><div>import std: xml, string, conv, random, algorithm;</div><div>import stache: game, battlecamera;</div><div><div>import stache.i: statemachine, entity, collider;</div>
</div><div>import stache.entity: combatant, paimei;</div><div>import stache.thinkers: localplayer, nullthinker;</div><div>import stache.sound: soundset, music;</div></div><div><div>import stache.util.eventtypes;</div></div>
<div><br></div><div>This is much better! Saved ~25 lines of import rubbish, and it also enforces logical grouping; individual import statements tends to lead to related submodules being distanced from eachother, this way, they appear on the same line.</div>
<div><br></div><div>Surely this has been considered before. Any reasons it's not supported?</div>