what's the difference between 'static import =' and 'import ='?

Derek Parnell derek at nomail.afraid.org
Tue Jul 18 23:28:12 PDT 2006


On Wed, 19 Jul 2006 06:14:11 +0000 (UTC), John Reimer wrote:

> In article <e9k8bv$2usv$1 at digitaldaemon.com>, Boris Wang says...
>>
>>For example:
>>
>>    * static import io = std.stdio;
>>    * import io = std.stdio;
>>
> 
> Good question.  Have you tested these first to see what happens or if the first
> even works?  I think that might answer your question.  Then you can tell those
> of us who haven't had a chance to try yet. :)
> 

There is no difference. They function in an identical manner.

  static import XXX;
  import XXX = whatever;
  static import XXX = whatever;

all require that 'XXX' be used to reference members in the code.

However, if you decide to allow non-FQN all you have to do is *add* the
line 'import XXX;' somewhere in your module and all the FQN requirements
disappear.

-- 
Derek
(skype: derek.j.parnell)
Melbourne, Australia
"Down with mediocrity!"
19/07/2006 4:22:03 PM



More information about the Digitalmars-d-learn mailing list