C Omega

看到一篇关于C omega 的 blog,看看未来的代码长什么样:

either { int; string; } x = 4711;
int ? n = x.Length;              // null
Type t = x.GetType();            // System.Int32

int* odds2 = nats.{if(it%2 == 1) yield return it;};

Book F = <Book>
          <Title>Faust</Title>
          <Author>Goethe</Author>
         </Book>;
Book K = <Book>
          <Title>De Klompeniers</Title>
          <Author>Jac. Broersen</Author>
         </Book>;

Book* books = { yield F; yield K; };
string* authors = books...Author;

Cω 主页:
http://research.microsoft.com/Comega/

posted on 2004-12-03 19:38  破宝  阅读(133)  评论(0编辑  收藏  举报

导航