One of the problems that people ran into was that there was no way to say "I
mean this type, really!". If you wrote something like:
System.Console. WriteLine()
and you had something named "System" in scope, you had to resort to aliases,
which is unsightly. It's especially bad if you're generating code, as
there's no easy way to know when the situation might come up.
For 2.0, you can write:
global::System. Console.WriteLi ne()
and know that you're really dealing with System.Console. WriteLine.
We also allow you to define an alias for something else (like IO below), and
use it in a similar manner.
We expect that the use of these will be rare.
--
Eric Gunnerson
Visit the C# product team at
http://www.csharp.net
Eric's blog is at
http://blogs.gotdotnet.com/ericgu/
This posting is provided "AS IS" with no warranties, and confers no rights.
<di********@dis cussion.microso ft.com> wrote in message
news:O$******** ******@TK2MSFTN GP09.phx.gbl...
Hi,
Why do the 2.0 namespace aliases use the "::" notation where before the
namespaces used dot notation ".".
Ie.,
using IO = System.IO;
IO::Blah.Blah() ..
instead of...
IO.Blah.Blah(). ..
Why why why the differnce?