`
oldrev
  • 浏览: 230186 次
  • 性别: Icon_minigender_1
  • 来自: 昆明
社区版块
存档分类
最新评论

DotMars 版 Hello World

阅读更多
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!
分享到:
评论
12 楼 oldrev 2007-07-23  
通过迭代器进行数组和链表的互操作性演示:

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

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

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

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

相关推荐

Global site tag (gtag.js) - Google Analytics