Why import statements are not allowed in function bodies (or any block of code)?

Larry lawrence.hemsley at gmail.com
Mon Jan 28 09:40:33 PST 2008


Leandro Lucarella Wrote:

> Is there any good reason for not allowing import statements in function
> bodies or any code block? I think it would be really useful for avoid
> namespace polution, specially in unittests (it's really ugly to import
> things a module will never use except for unittesting).
> 
> -- 
> Leandro Lucarella (luca) | Blog colectivo: http://www.mazziblog.com.ar/blog/
> ----------------------------------------------------------------------------
> GPG Key: 5F5A8D05 (F8CD F9A7 BF00 5431 4145  104C 949E BFB6 5F5A 8D05)
> ----------------------------------------------------------------------------
> Long you live and high you fly
> And smiles you'll give and tears you'll cry
> And all you touch and all you see
> Is all your life will ever be. 

Good answer.
Another Pink Floyd fan!!!!

Larry



More information about the Digitalmars-d mailing list