Why can't we put import in functions.
Daniel Keep
daniel.keep.lists at gmail.com
Tue Oct 16 01:23:33 PDT 2007
Yang Bo wrote:
> Don Clugston 写道:
>> Bill Baxter wrote:
>>> Yang Bo wrote:
>>>> We can put "using namesapce" in any place in C++. Why not do the same
>>>> way in D?
>>> Yes it is lacking. Definitely on my top ten features list for D.
>>>
>>> --bb
>> It's particularly annoying that you can't use import in unittest{} blocks.
>
> And, why do we need to write static import? Compiler should look for .d
> files automaticly as Java.
Umm... what exactly are you saying? 'static import' does the same thing
as 'import' except it doesn't expose the contents of the module into
global scope, just the FQN.
And neither have an effect on how the compiler looks for .d files.
I have a feeling you want D to compile like Java does; specify the first
file and the compiler pulls in all the dependant modules. There have
been various proposals to do this before, however Walter feels the
advantages outweigh the inconvenience. Also, since we have tools like
dsss and bud, it's not really an issue.
-- Daniel
More information about the Digitalmars-d
mailing list