C# compiler uses Duck-Typing, not IEnumerable, for foreach loops(blogs.msdn.com)

submitted by dpetersondpeterson(4397) 8 months, 16 days ago

Turns out that according to this post, and the C# 1.0 specification, that foreach loops in C# do not use IEnumerable (as found in the documentation) but rather duck-typing. Not necessarily consequential to our every day programming lives, but interesting nonetheless.

1 comment |category: |Views: 70

tags: another

new Add a live kick counter to your blog >> liveImage

You can even customize the image by choosing your own colors, and then clicking the button below to update the preview and the html code:

  • "Kick It" text
  • "Kick It" background
  • kick count text
  • kick count background
  • border

Simply copy and paste this HTML into your blog post.


Users who kicked this story:
Comments:

posted by vijaystvijayst(1311) 8 months, 15 days ago 0

To add to the post, duck typing refers to dynamic typing. Duck test refers to the following idea: "When I see a bird that walks like a duck and swims like a duck and quacks like a duck, I call that bird a duck." In the above post, MyThings behaves like IEnumerable interface.

Reply

information Login or create an account to comment on this story