首页 > 代码库 > Swift----安装,简单介绍

Swift----安装,简单介绍


安装:

眼下最新的稳定版是 Swift 0.94.1

1.下载:wget http://swiftlang.org/packages/swift-0.94.1.tar.gz


2.解压:tar xfz swift-0.94.1.tar.gz


3.加入到PATH:export PATH=$PATH:~/swift-0.94.1/bin


4.动行swift

cd swift-0.94.1/examples/swift hello.swift

我是这样做的,似乎文档过时了:bin/swift examples/swift/tutorial/hello.swift

结果所看到的:

Swift 0.94.1 swift-r7114 cog-r3803 

RunID: 20140603-1042-s00t01r6 

ProgresstimeTue, 03 Jun 2014 10:42:05 +0800 

Final statusTue, 03 Jun 2014 10:42:05 +0800 Finished successfully:1


5.測试一下:看看hello.swift

type messagefile; 

app (messagefile t) greeting() { 
	 echo "Hello, world!" stdout=@filename(t); 
 } 
 messagefile outfile <"hello.txt">; 
 outfile = greeting();


Swift----安装,简单介绍