2007-06-05

DotMars 版 Hello World

关键字: Dotmars D
DotMars 已经具有初步的样子了,特别发帖庆祝。

DotMars 第一个范例程序(dotmars/samples/io/console.d):

D 代码
 
  1. module samples.io.console;  
  2.   
  3. import dotmars.io.console;  
  4.   
  5. void main()  
  6. {  
  7.     class Foo {  
  8.         override char[] toString() {  
  9.             return "Greeting!";  
  10.         }  
  11.     }  
  12.      
  13.     Console.writeLine("Hello World!");  
  14.     Console.writeLineFormatted("Format object:  {0}"new Foo);  
  15.     Console.writeLineFormatted("Format float:   PI={0:D4}", 3.1415926);  
  16.     Console.writeLineFormatted("String & Integers: {2} {0:X} {1}", 0xFFFF, 123456, "Console");  
  17.     Console.writeLineFormatted("Aligned String: =={0, 10}==""DotMars");  
  18. }  


编译:
  1. 安装配置好 DSSS
  2. 从 SVN 里下载代码: svn export http://dotmars.googlecode.com/svn/trunk/ dotmars
  3. 进入 dotmars 目录,执行 dsss build 和 dsss install
  4. 进入 samples 目录,执行 dsss build
  5. 执行 dotmars/samples/io 目录下的 console.exe(Windows) 或 console(Linux).
Enjoy It!
评论
oldrev 2007-07-23
通过迭代器进行数组和链表的互操作性演示:

http://dotmars.googlecode.com/svn/trunk/samples/base/collections.d
oldrev 2007-07-20
新加了 iterator 和 双向链表类 dotmars.base.collection.list.List
oldrev 2007-07-13
昨天我刚好修改了这个地方,以前一直是在linux下编译,没有发现这个错误
tuja 2007-07-13
编译错误:
time.d(1033) void has no value

可能是因为 GetSystemTimeAsFileTime(&ft)函数没有返回值,不能进行比较

把这行注释掉就可以通过编译了。

DMD1.018
oldrev 2007-06-23
什么事件?这个项目目前还处于非常初级的阶段,而且D是一种新语言,我的经验有限,而且也没有太多时间开发.
所以,一切答案都在代码里,就像 Linux他爹说的, Read the f**king source
niijyeni 2007-06-23
请问这个支持事件吗?
niijyeni 2007-06-23
连接速度很低,不过最终还是下载下来了,花了很长时间
oldrev 2007-06-23
为什么下载不了?
niijyeni 2007-06-23
下载不了啊,
oldrev 2007-06-05
不支持了,完全是 .Net 风格的。
qiezi 2007-06-05
还支持printf风格的format吗?
tomqyp 2007-06-05
祝贺~
发表评论

您还没有登录,请登录后发表评论

oldrev
搜索本博客
我的相册
7e9318d5-c74f-36e0-81a3-beb68acaa2b8-thumb
Screenshot
共 1 张
最近加入圈子
存档
最新评论