Cω?取代C#的東東?—–C#的擴充語言~

來源:互聯網
上載者:User

我看C#大部分人都還沒學會吧!微軟又在研究個新東東了,名字夠怪的,叫Cω,ω是個數學中的符號,MS網站上說是作為C#的一個擴充語言,關於它的文法,第一次看到,讓人看了發暈,不知在寫什麼。

看下面的程式碼片段:

片段1:

using Microsoft.Comega;using System;public class NewsItem{  attribute  string title;  attribute  string author;  struct { DateTime date; string body; }   public static void Main(){    NewsItem news = <NewsItem title="Hello World" author="Dare Obasanjo">                      <date>{DateTime.Now}</date>                      <body>I am the first post of the New Year.</body>                    </NewsItem>;    Console.WriteLine(news.title + " by " + news.author + " on " + news.date);      }}片段2:
foreach (b in bs.book){  yield return <result>         {b.title}         {b.author}        </result>}

怎麼樣?暈了吧,居然可以在代碼中直接就寫入XML標籤,並且進行調用,輸出關於它在MSDN中有它的介紹和例子:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnexxml/html/xml01142005.asp

http://research.microsoft.com/Comega/doc/comega_startpage.htm

現在已經有它的編譯器了,並且安裝後可以整合中VS。NET中進行開發,應用。

Cω編譯器下載頁面:

http://research.microsoft.com/research/downloads/download.aspx?FUID={92E68CF7-BA75-4142-9ED0-25DAED04EFD7}

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.