importing modules from a function

Hugo Florentino hugo at acdam.cu
Sat Dec 28 06:23:05 PST 2013


Hi,

A moment ago I was reading a reply to one of my posts, and noticed 
Artur Skawina did this:

> void main(string argv[]) {
>    import std.string;
> ...

I didn't know D allowed importing modules from a function.
Now, my question is: what is the advantage of this over importing the 
regular way?

Regards, Hugo


More information about the Digitalmars-d-learn mailing list