std.compress

Adam D. Ruppe destructionator at gmail.com
Tue Jun 4 05:17:30 PDT 2013


I actually wish we could have multiple modules in a single file. 
Correct me if I'm wrong, but if imported something and only used 
one type there, the linker should strip out the others, right?

But this doesn't happen because ModuleInfo references all kinds 
of things, and moduleinfo is referenced for constructors and 
such. This is useful and removing it is probably a bad idea.

Breaking up into packages is one idea but you can't always do it. 
What if you're doing some big string mixins? A single file is 
also a little easier to distribute.

But mixins is the case that is hard to work around since they by 
definition go into one file. If we could do something like 
mixin("module foo.mixin"~name~" { code }"); you could work around 
it.

Then you could isolate sections of generated code in their own 
logical modules, letting the linker kill those sections if they 
aren't actually used.


More information about the Digitalmars-d mailing list