D语言程序库 Tango

fmms 13年前
     <p>Tango 是一种跨平台的开放源码D语言软件库。这是一个全面的常用工具库,并得到越来越多的D语言爱好者的喜爱。</p>    <p>下面是一个用来将文件内容一行行输出的代码示例:</p>    <pre class="brush:java; toolbar: true; auto-links: false;">private import  tango.io.Console,                 tango.io.device.File;  private import  tango.io.stream.Lines;  void main (char[][] args) {           if (args.length is 2)            {            // open a file for reading            auto file = new File (args[1]);             // create a line oriented iterator, and use it to sweep the file            foreach (line; new Lines!(char) (file))                     Cout (line).newline;            }         else            Cout ("usage: ")(args[0])(" <filename>").newline; }</pre>    <p><strong>项目主页:</strong><a href="http://www.open-open.com/lib/view/home/1326936103015" target="_blank">http://www.open-open.com/lib/view/home/1326936103015</a></p>    <p></p>