Chinaunix首页 | 论坛 | 博客
  • 博客访问: 93772
  • 博文数量: 17
  • 博客积分: 42
  • 博客等级: 上尉
  • 技术积分: 180
  • 用 户 组: 普通用户
  • 注册时间: 2008-03-24 01:27
文章分类
文章存档

2011年(1)

2010年(16)

分类:

2010-08-26 10:23:59



-----------------------------------------
D:\GNU\fantom-1.0.54\bin>fansh
Fantom Shell v1.0.54 ('?' for help)
fansh> echo("hello world #1")
hello world #1
fansh> quit

D:\GNU\fantom-1.0.54\bin>vim hello.fan

D:\GNU\fantom-1.0.54\bin>fan hello.fan
hello world #2

D:\GNU\fantom-1.0.54\bin>type hello.fan
class Hello{
static Void main(){
echo("hello world #2")
}
}

D:\GNU\fantom-1.0.54\bin>vim fwt-test.fan

D:\GNU\fantom-1.0.54\bin>fan fwt-test.fan

D:\GNU\fantom-1.0.54\bin>type fwt-test.fan
using fwt
class MyWindow:Test{
Void main(){
Window{
Label{text="Hello world"},
}.open
}
}

D:\GNU\fantom-1.0.54\bin>fan fwt-test.fan

D:\GNU\fantom-1.0.54\bin>vim webapp-test.fan


D:\GNU\fantom-1.0.54\bin>vim webapp-test.fan

D:\GNU\fantom-1.0.54\bin>type webapp-test.fan
using util
using web
using wisp
class WebHelloWorld:AbstractMain{
@Opt {help = "http port"}
Int port := 8080
override Int run(){
wisp := WispService{
it.port = this.port
it.root = HelloMod()
}
return runServices([wisp])
}
}
const class HelloMod:WebMod{
override Void onGet(){
res.headers["Content-Type"]="text/plain';charset=utf-8"
res.out.print("hello world #4")
}
}

D:\GNU\fantom-1.0.54\bin>fan webapp-test.fan
[16:14:01 25-Aug-10] [info] [web] WispService started on port 8080
阅读(3811) | 评论(0) | 转发(0) |
0

上一篇:tessellations的艺术

下一篇:Yet Anothor 通宵

给主人留下些什么吧!~~