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

Leandro Lucarella llucax at gmail.com
Sun Jan 27 18:25:39 PST 2008


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. 



More information about the Digitalmars-d mailing list