Leandro Lucarella <l...@llucax.com.ar> писал(а) в своём письме Sat, 13 Nov
2010 21:13:42 +0600:
retard, el 13 de noviembre a las 08:24 me escribiste:
> void main(string[] args){
>
> import std.stdio; // 1. will not compile> void main(string[]
args){
> writeln("hello");
> }
<...> the 1) point make me ask, why
imports can't be used inside methods just like in Scala. There's no
technical reason other than "this adds bugs!"
Maybe it will somehow affect compile time or complicate module dependency
analysis ?
Python allows that too, that's why I opened an enhancement request:
http://d.puremagic.com/issues/show_bug.cgi?id=3506
As the bugzilla issue shows, this is particularly annoying when combined
with unittest.
Even if there are technical issues, special case for unit tests sounds
like a good improvement of usability
--
Alexander