[nem-en] About opening namespace

Kamil Skalski kamil.skalski at gmail.com
Sun Aug 6 11:56:47 CEST 2006


>    Whether should work the following code?

I don't think so... By specifying 'using A' you just say that you want
to have classes with names A.* available. Every using declaration is
rooted in the currently opened namespace:

using A;   ///  root.A

namespace B {
  using C;  // opens  root.C  and B.C
}

The "nesting" logic of using that you propose is a bit strange,
especially that by looking at code it is not easily visible, that

using A;
using B;
...

would mean:

using A {
  using root.B
  using A.B;
  ...
}


And most importantly - it is quite a large breaking change, which is
moreover not consistent with C#'s behaviour.

>
>    using System;
>
>    namespace X
>    {
>      // It assumes, that namespace System is opened earlier
>      using Collections;
>      ...
>    }
>
>    In C# this code will not work, but in my opinion it's logical.
>
>
> _______________________________________________
> https://nemerle.org/mailman/listinfo/devel-en
>


-- 
Kamil Skalski
http://nazgul.omega.pl



More information about the devel-en mailing list