currently when no module declaration is given, the module name is given by the path base name (__FILE__.baseName.stripExtension).<div>This is rarely useful (as soon as one has modules nested in packages).<br><div>Why not instead infer the module name from the relative path of __FILE__ with respect to the first directory in the import list in which __FILE__ is found:</div>
</div><div><br></div><div><div>---- src/foo/bar.d:</div><div>// infers 'module foo.bar;' instead of 'module bar;'</div><div>void barfun(){}</div><div>----</div></div><div><br></div><div><div>---- src/main.d:</div>
<div>import foo.bar;</div><div>void main(){}</div><div>----</div></div><div><br></div><div>dmd -Isrc src/main.d</div>