Is "importing a static class" actually declared or a hint of a future C # function?

Starting with this edit , the C # Wikipedia article mentions โ€œstatic import of classesโ€ as a future C # function, as well as โ€œCompiler as a Service (โ€œ Roslyn โ€).

Was this feature announced or planned by a member of the compiler team, or is it just wild speculation?

+6
source share
2 answers

In an article by Eric Lippert, which is most likely the source of this , he discusses the use of C # as a scripting language. And, Roslyn CTP includes an interactive C # window and a C # scripting engine.

C # Interactive uses a slightly different version of C #. For example, you do not always need semicolons, and you can use top-level methods and top-level instructions. And you can also use import of a static class:

> using System.Math; > Abs(-5) 5 

Because of this, I think that static import of classes (along with the other scripty functions I described) will not be included in the regular version of C #, but you can use them in C # scripts.

+1
source

Eric Lippert posted a post about this feature , but he did not promise implementation.

+2
source

Source: https://habr.com/ru/post/917940/


All Articles