[Swift-commit] r3687 - trunk/examples
noreply at svn.ci.uchicago.edu
noreply at svn.ci.uchicago.edu
Sun Oct 24 22:12:21 CDT 2010
Author: davidk
Date: 2010-10-24 22:12:18 -0500 (Sun, 24 Oct 2010)
New Revision: 3687
Modified:
trunk/examples/iterate.swift
trunk/examples/manyparam.swift
trunk/examples/parameter.swift
trunk/examples/q5.swift
trunk/examples/restart.swift
trunk/examples/second_procedure.swift
trunk/examples/types.swift
Log:
Bug fixes to tutorial and updates for consistency
Modified: trunk/examples/iterate.swift
===================================================================
--- trunk/examples/iterate.swift 2010-10-19 18:53:24 UTC (rev 3686)
+++ trunk/examples/iterate.swift 2010-10-25 03:12:18 UTC (rev 3687)
@@ -1,15 +1,11 @@
type counterfile;
-(counterfile t) echo(string m) {
- app {
+app (counterfile t) echo(string m) {
echo m stdout=@filename(t);
- }
}
-(counterfile t) countstep(counterfile i) {
- app {
+app (counterfile t) countstep(counterfile i) {
wcl @filename(i) @filename(t);
- }
}
counterfile a[] <simple_mapper;prefix="foldout">;
Modified: trunk/examples/manyparam.swift
===================================================================
--- trunk/examples/manyparam.swift 2010-10-19 18:53:24 UTC (rev 3686)
+++ trunk/examples/manyparam.swift 2010-10-25 03:12:18 UTC (rev 3687)
@@ -1,9 +1,7 @@
type messagefile;
-(messagefile t) greeting (string s) {
- app {
- echo s stdout=@filename(t);
- }
+app (messagefile t) greeting (string s) {
+ echo s stdout=@filename(t);
}
messagefile english <"english.txt">;
Modified: trunk/examples/parameter.swift
===================================================================
--- trunk/examples/parameter.swift 2010-10-19 18:53:24 UTC (rev 3686)
+++ trunk/examples/parameter.swift 2010-10-25 03:12:18 UTC (rev 3687)
@@ -1,9 +1,7 @@
type messagefile;
-(messagefile t) greeting (string s) {
- app {
- echo s stdout=@filename(t);
- }
+app (messagefile t) greeting (string s) {
+ echo s stdout=@filename(t);
}
messagefile outfile <"hello2.txt">;
Modified: trunk/examples/q5.swift
===================================================================
--- trunk/examples/q5.swift 2010-10-19 18:53:24 UTC (rev 3686)
+++ trunk/examples/q5.swift 2010-10-25 03:12:18 UTC (rev 3687)
@@ -1,9 +1,7 @@
type messagefile;
-(messagefile t) greeting (string s[]) {
- app {
- echo s[0] s[1] s[2] stdout=@filename(t);
- }
+app (messagefile t) greeting (string s[]) {
+ echo s[0] s[1] s[2] stdout=@filename(t);
}
messagefile outfile <"q5out.txt">;
Modified: trunk/examples/restart.swift
===================================================================
--- trunk/examples/restart.swift 2010-10-19 18:53:24 UTC (rev 3686)
+++ trunk/examples/restart.swift 2010-10-25 03:12:18 UTC (rev 3687)
@@ -1,27 +1,19 @@
type file;
-(file f) touch() {
- app {
+app (file f) touch() {
touch @f;
- }
}
-(file f) processL(file inp) {
- app {
+app (file f) processL(file inp) {
echo "processL" stdout=@f;
- }
}
-(file f) processR(file inp) {
- app {
+app (file f) processR(file inp) {
broken "process" stdout=@f;
- }
}
-(file f) join(file left, file right) {
- app {
+app (file f) join(file left, file right) {
echo "join" @left @right stdout=@f;
- }
}
file f = touch();
Modified: trunk/examples/second_procedure.swift
===================================================================
--- trunk/examples/second_procedure.swift 2010-10-19 18:53:24 UTC (rev 3686)
+++ trunk/examples/second_procedure.swift 2010-10-25 03:12:18 UTC (rev 3687)
@@ -1,15 +1,11 @@
-type messagefile {}
+type messagefile;
-(messagefile t) greeting (string s) {
- app {
- echo s stdout=@filename(t);
- }
+app (messagefile t) greeting (string s) {
+ echo s stdout=@filename(t);
}
-(messagefile o) capitalise(messagefile i) {
- app {
- tr "[a-z]" "[A-Z]" stdin=@filename(i) stdout=@filename(o);
- }
+app (messagefile o) capitalise(messagefile i) {
+ tr "[a-z]" "[A-Z]" stdin=@filename(i) stdout=@filename(o);
}
messagefile hellofile <"hello.txt">;
Modified: trunk/examples/types.swift
===================================================================
--- trunk/examples/types.swift 2010-10-19 18:53:24 UTC (rev 3686)
+++ trunk/examples/types.swift 2010-10-25 03:12:18 UTC (rev 3687)
@@ -1,14 +1,12 @@
-type messagefile {}
+type messagefile;
type details {
string name;
int pies;
}
-(messagefile t) greeting (details d) {
- app {
- echo "Hello. Your name is" d.name "and you have eaten" d.pies "pies." stdout=@filename(t);
- }
+app (messagefile t) greeting (details d) {
+ echo "Hello. Your name is" d.name "and you have eaten" d.pies "pies." stdout=@filename(t);
}
details person;
More information about the Swift-commit
mailing list