How separated are C # and .NET?

I see language features such as the C # loop foreach(which requires use IEnumerable), and its syntax using(which uses IDisposable, knowing which method to call) and LINQ (which I assume uses a bunch of .NET materials too). It all seems very tied to the .NET platform. So:

  • Can C # exist with a different structure? (Is that already?)
  • If so, how does the language indicate that "foreach loops require an IEnumerable instance" without binding it to the structure.
+5
source share
2 answers

#. , :

10.14.2

System.Collections.IEnumerable System.Collections.Generic.IEnumerable. IEnumerable IEnumerable, .

...

10.14.5.1 GetEnumerator

GetEnumerator IEnumerable IEnumerable . GetEnumerator , . , , , , . 10.14.4.

, .NET BCL, , (.. .NET) , # .

, .NET, :

. Microsoft.NET #.

foreach IEnumerable; " ", 8.8.4 .

+6
  • - Mono - .NET Framework.
  • , . .Net CLR, Mono.
+3

All Articles