[Swift-commit] r7053 - in SwiftApps/tryswift: . scripts
davidk at ci.uchicago.edu
davidk at ci.uchicago.edu
Tue Sep 10 15:33:02 CDT 2013
Author: davidk
Date: 2013-09-10 15:33:02 -0500 (Tue, 10 Sep 2013)
New Revision: 7053
Added:
SwiftApps/tryswift/index.php
SwiftApps/tryswift/scripts/p1.swift
SwiftApps/tryswift/scripts/p2.swift
SwiftApps/tryswift/scripts/p3.swift
SwiftApps/tryswift/scripts/p4.swift
SwiftApps/tryswift/scripts/p5.swift
SwiftApps/tryswift/scripts/p6.swift
Removed:
SwiftApps/tryswift/index.html
SwiftApps/tryswift/scripts/arrays.swift
SwiftApps/tryswift/scripts/capitalise.swift
SwiftApps/tryswift/scripts/capitalise_anonymous.swift
SwiftApps/tryswift/scripts/default.swift
SwiftApps/tryswift/scripts/fixed_array_mapper.swift
SwiftApps/tryswift/scripts/foreach.swift
SwiftApps/tryswift/scripts/hello.swift
SwiftApps/tryswift/scripts/if.swift
SwiftApps/tryswift/scripts/manyparam.swift
SwiftApps/tryswift/scripts/my_first_mapper.swift
SwiftApps/tryswift/scripts/parameter.swift
SwiftApps/tryswift/scripts/regexp_mapper.swift
SwiftApps/tryswift/scripts/restart.swift
SwiftApps/tryswift/scripts/sequential_iteration.swift
SwiftApps/tryswift/scripts/sleep.swift
SwiftApps/tryswift/scripts/types.swift
Log:
Dynamic generation of available scripts based on contents of scripts/ directory
Use tutorial scripts from swift-cray-tutorial
Deleted: SwiftApps/tryswift/index.html
===================================================================
--- SwiftApps/tryswift/index.html 2013-09-10 19:41:45 UTC (rev 7052)
+++ SwiftApps/tryswift/index.html 2013-09-10 20:33:02 UTC (rev 7053)
@@ -1,86 +0,0 @@
-<html>
- <link rel="stylesheet" type="text/css" href="tryswift.css">
- <head>
- <title>Try Swift</title>
- </head>
-
- <body>
- <div id="header">
- <hr>
- Try Swift
- <hr>
- </div>
-
- <div id="wrap">
- <div id="wrapHeader">
- <br>
- Enter your Swift code below
- </div>
- <form name="sourceForm" action="http://54.212.60.65:8080/tryswift.php" method="POST">
- <div id="textAreaDiv">
- <textarea id="source" name="source" spellcheck="false" wrap="physical"></textarea><br>
- </div>
- <div id="progsDiv">
- <div id="progsDivText">
- Example Programs<br><br>
- <ul>
- <li><input type="radio" name="existingApplications" value="scripts/hello.swift" onclick="addtext()">hello.swift</li>
- <li><input type="radio" name="existingApplications" value="scripts/manyparam.swift" onclick="addtext()">manyparam.swift</li>
- <li><input type="radio" name="existingApplications" value="scripts/capitalise.swift" onclick="addtext()">capitalise.swift</li>
- <li><input type="radio" name="existingApplications" value="scripts/default.swift" onclick="addtext()">default.swift</li>
- <li><input type="radio" name="existingApplications" value="scripts/if.swift" onclick="addtext()">if.swift</li>
- <li><input type="radio" name="existingApplications" value="scripts/manyparam.swift" onclick="addtext()">manyparam.swift</li>
- <li><input type="radio" name="existingApplications" value="scripts/parameter.swift" onclick="addtext()">parameter.swift</li>
- <li><input type="radio" name="existingApplications" value="scripts/sleep.swift" onclick="addtext()">sleep.swift</li>
- <li><input type="radio" name="existingApplications" value="scripts/types.swift" onclick="addtext()">types.swift</li>
- </ul>
- </div>
- </div>
- <div id="submitButton">
- <input type="submit" name="submit" value="Submit" />
- </div>
- <div id="appsDiv">
- <div id="appsDivText">
- Available Applications<br><br>
- <ul>
- <li>echo</li>
- <li>cat</li>
- <li>ls</li>
- <li>grep</li>
- <li>sort</li>
- <li>paste</li>
- <li>cp</li>
- <li>touch</li>
- <li>wc</li>
- <li>sleep</li>
- </ul>
- </div>
- </div>
- </form>
- </div>
-
- <script type="text/javascript">
-
- function addtext() {
- var filePath = "http://swiftlang.org/tryswift/" + getRadioValue();
- var xmlhttp = new XMLHttpRequest();
- xmlhttp.open("GET", filePath, false);
- xmlhttp.send(null);
- var fileContent = xmlhttp.responseText;
- document.getElementById('source').value = fileContent;
- }
-
- function getRadioValue() {
- var l = sourceForm.existingApplications.length;
- var radio_value;
- for(var i=0; i<l; i++) {
- if(sourceForm.existingApplications[i].checked)
- radio_value = sourceForm.existingApplications[i].value;
- }
- return radio_value;
- }
-
- </script>
- </div>
- </body>
-</html>
Added: SwiftApps/tryswift/index.php
===================================================================
--- SwiftApps/tryswift/index.php (rev 0)
+++ SwiftApps/tryswift/index.php 2013-09-10 20:33:02 UTC (rev 7053)
@@ -0,0 +1,94 @@
+<html>
+ <link rel="stylesheet" type="text/css" href="tryswift.css">
+ <head>
+ <title>Try Swift</title>
+ </head>
+
+ <body>
+ <div id="header">
+ <hr>
+ Try Swift
+ <hr>
+ </div>
+
+ <div id="wrap">
+ <div id="wrapHeader">
+ <br>
+ Enter your Swift code below
+ </div>
+ <form name="sourceForm" action="http://54.212.60.65:8080/tryswift.php" method="POST">
+ <div id="textAreaDiv">
+ <textarea id="source" name="source" spellcheck="false" wrap="physical"></textarea><br>
+ </div>
+ <div id="progsDiv">
+ <div id="progsDivText">
+ Example Programs<br><br>
+ <ul>
+
+ <?php
+ $scriptFiles = array();
+
+ $directory = opendir("scripts");
+ while($script = readdir($directory)) {
+ if(substr($script, -6) == ".swift") {
+ $scriptFiles[] = $script;
+ }
+ }
+ closedir($directory);
+
+ sort($scriptFiles);
+ foreach($scriptFiles as $script) {
+ echo "<li><input type=\"radio\" name=\"existingApplications\" value=\"scripts/$script\" onclick=\"addtext()\">$script</li>\n";
+ }
+ ?>
+ </ul>
+ </div>
+ </div>
+ <div id="submitButton">
+ <input type="submit" name="submit" value="Submit" />
+ </div>
+ <div id="appsDiv">
+ <div id="appsDivText">
+ Available Applications<br><br>
+ <ul>
+ <li>echo</li>
+ <li>cat</li>
+ <li>ls</li>
+ <li>grep</li>
+ <li>sort</li>
+ <li>paste</li>
+ <li>cp</li>
+ <li>touch</li>
+ <li>wc</li>
+ <li>sleep</li>
+ </ul>
+ </div>
+ </div>
+ </form>
+ </div>
+
+ <script type="text/javascript">
+
+ function addtext() {
+ var filePath = "http://swiftlang.org/tryswift/" + getRadioValue();
+ var xmlhttp = new XMLHttpRequest();
+ xmlhttp.open("GET", filePath, false);
+ xmlhttp.send(null);
+ var fileContent = xmlhttp.responseText;
+ document.getElementById('source').value = fileContent;
+ }
+
+ function getRadioValue() {
+ var l = sourceForm.existingApplications.length;
+ var radio_value;
+ for(var i=0; i<l; i++) {
+ if(sourceForm.existingApplications[i].checked)
+ radio_value = sourceForm.existingApplications[i].value;
+ }
+ return radio_value;
+ }
+
+ </script>
+ </div>
+ </body>
+</html>
Deleted: SwiftApps/tryswift/scripts/arrays.swift
===================================================================
--- SwiftApps/tryswift/scripts/arrays.swift 2013-09-10 19:41:45 UTC (rev 7052)
+++ SwiftApps/tryswift/scripts/arrays.swift 2013-09-10 20:33:02 UTC (rev 7053)
@@ -1,12 +0,0 @@
-type messagefile;
-
-app (messagefile t) greeting (string s[]) {
- echo s[0] s[1] s[2] stdout=@filename(t);
-}
-
-messagefile outfile <"arrays.txt">;
-
-string words[] = ["how","are","you"];
-
-outfile = greeting(words);
-
Deleted: SwiftApps/tryswift/scripts/capitalise.swift
===================================================================
--- SwiftApps/tryswift/scripts/capitalise.swift 2013-09-10 19:41:45 UTC (rev 7052)
+++ SwiftApps/tryswift/scripts/capitalise.swift 2013-09-10 20:33:02 UTC (rev 7053)
@@ -1,14 +0,0 @@
-type messagefile;
-
-app (messagefile t) greeting (string s) {
- echo s stdout=@filename(t);
-}
-
-app (messagefile o) capitalise(messagefile i) {
- tr "[a-z]" "[A-Z]" stdin=@filename(i) stdout=@filename(o);
-}
-
-messagefile hellofile <"capitalise.1.txt">;
-messagefile final <"capitalise.2.txt">;
-hellofile = greeting("hello from Swift");
-final = capitalise(hellofile);
Deleted: SwiftApps/tryswift/scripts/capitalise_anonymous.swift
===================================================================
--- SwiftApps/tryswift/scripts/capitalise_anonymous.swift 2013-09-10 19:41:45 UTC (rev 7052)
+++ SwiftApps/tryswift/scripts/capitalise_anonymous.swift 2013-09-10 20:33:02 UTC (rev 7053)
@@ -1,14 +0,0 @@
-type messagefile;
-
-app (messagefile t) greeting (string s) {
- echo s stdout=@filename(t);
-}
-
-app (messagefile o) capitalise(messagefile i) {
- tr "[a-z]" "[A-Z]" stdin=@filename(i) stdout=@filename(o);
-}
-
-messagefile hellofile;
-messagefile final <"capitalise_anonymous.txt">;
-hellofile = greeting("hello from Swift");
-final = capitalise(hellofile);
Deleted: SwiftApps/tryswift/scripts/default.swift
===================================================================
--- SwiftApps/tryswift/scripts/default.swift 2013-09-10 19:41:45 UTC (rev 7052)
+++ SwiftApps/tryswift/scripts/default.swift 2013-09-10 20:33:02 UTC (rev 7053)
@@ -1,15 +0,0 @@
-type file;
-
-// s has a default value
-app (file t) echo (string s="hello world") {
- echo s stdout=@filename(t);
-}
-
-file hw1<"default.1.txt">;
-file hw2<"default.2.txt">;
-
-// procedure call using the default value
-hw1 = echo();
-
-// using a different value
-hw2 = echo(s="hello again");
Deleted: SwiftApps/tryswift/scripts/fixed_array_mapper.swift
===================================================================
--- SwiftApps/tryswift/scripts/fixed_array_mapper.swift 2013-09-10 19:41:45 UTC (rev 7052)
+++ SwiftApps/tryswift/scripts/fixed_array_mapper.swift 2013-09-10 20:33:02 UTC (rev 7053)
@@ -1,16 +0,0 @@
-type messagefile;
-type countfile;
-
-app (countfile t) countwords (messagefile f) {
- wc "-w" @filename(f) stdout=@filename(t);
-}
-
-string inputNames = "fixed_array_mapper.1.txt fixed_array_mapper.2.txt fixed_array_mapper.3.txt";
-string outputNames = "fixed_array_mapper.1.count fixed_array_mapper.2.count fixed_array_mapper.3.count";
-
-messagefile inputfiles[] <fixed_array_mapper;files=inputNames>;
-countfile outputfiles[] <fixed_array_mapper;files=outputNames>;
-
-outputfiles[0] = countwords(inputfiles[0]);
-outputfiles[1] = countwords(inputfiles[1]);
-outputfiles[2] = countwords(inputfiles[2]);
Deleted: SwiftApps/tryswift/scripts/foreach.swift
===================================================================
--- SwiftApps/tryswift/scripts/foreach.swift 2013-09-10 19:41:45 UTC (rev 7052)
+++ SwiftApps/tryswift/scripts/foreach.swift 2013-09-10 20:33:02 UTC (rev 7053)
@@ -1,18 +0,0 @@
-type messagefile;
-type countfile;
-
-app (countfile t) countwords (messagefile f) {
- wc "-w" @filename(f) stdout=@filename(t);
-}
-
-string inputNames = "foreach.1.txt foreach.2.txt foreach.3.txt";
-
-messagefile inputfiles[] <fixed_array_mapper;files=inputNames>;
-
-foreach f in inputfiles {
- countfile c<regexp_mapper;
- source=@f,
- match="(.*)txt",
- transform="\\1count">;
- c = countwords(f);
-}
Deleted: SwiftApps/tryswift/scripts/hello.swift
===================================================================
--- SwiftApps/tryswift/scripts/hello.swift 2013-09-10 19:41:45 UTC (rev 7052)
+++ SwiftApps/tryswift/scripts/hello.swift 2013-09-10 20:33:02 UTC (rev 7053)
@@ -1,10 +0,0 @@
-type messagefile;
-
-app (messagefile t) greeting() {
- echo "Hello, world!" stdout=@filename(t);
-}
-
-messagefile outfile <"hello.txt">;
-
-outfile = greeting();
-
Deleted: SwiftApps/tryswift/scripts/if.swift
===================================================================
--- SwiftApps/tryswift/scripts/if.swift 2013-09-10 19:41:45 UTC (rev 7052)
+++ SwiftApps/tryswift/scripts/if.swift 2013-09-10 20:33:02 UTC (rev 7053)
@@ -1,16 +0,0 @@
-type messagefile;
-
-app (messagefile t) greeting (string s) {
- echo s stdout=@filename(t);
-}
-
-messagefile outfile <"if.txt">;
-
-boolean morning = true;
-
-if(morning) {
- outfile = greeting("good morning");
-} else {
- outfile = greeting("good afternoon");
-}
-
Deleted: SwiftApps/tryswift/scripts/manyparam.swift
===================================================================
--- SwiftApps/tryswift/scripts/manyparam.swift 2013-09-10 19:41:45 UTC (rev 7052)
+++ SwiftApps/tryswift/scripts/manyparam.swift 2013-09-10 20:33:02 UTC (rev 7053)
@@ -1,13 +0,0 @@
-type messagefile;
-
-app (messagefile t) greeting (string s) {
- echo s stdout=@filename(t);
-}
-
-messagefile english <"manyparam.english.txt">;
-messagefile french <"manyparam.french.txt">;
-messagefile japanese <"manyparam.japanese.txt">;
-
-english = greeting("hello");
-french = greeting("bonjour");
-japanese = greeting("konnichiwa");
Deleted: SwiftApps/tryswift/scripts/my_first_mapper.swift
===================================================================
--- SwiftApps/tryswift/scripts/my_first_mapper.swift 2013-09-10 19:41:45 UTC (rev 7052)
+++ SwiftApps/tryswift/scripts/my_first_mapper.swift 2013-09-10 20:33:02 UTC (rev 7053)
@@ -1,9 +0,0 @@
-type messagefile;
-
-app (messagefile t) greeting() {
- echo "hello" stdout=@filename(t);
-}
-
-messagefile outfile <my_first_mapper>;
-
-outfile = greeting();
Added: SwiftApps/tryswift/scripts/p1.swift
===================================================================
--- SwiftApps/tryswift/scripts/p1.swift (rev 0)
+++ SwiftApps/tryswift/scripts/p1.swift 2013-09-10 20:33:02 UTC (rev 7053)
@@ -0,0 +1,9 @@
+type file;
+
+app (file o) simulation ()
+{
+ simulate stdout=@filename(o);
+}
+
+file f <"sim.out">;
+f = simulation();
Added: SwiftApps/tryswift/scripts/p2.swift
===================================================================
--- SwiftApps/tryswift/scripts/p2.swift (rev 0)
+++ SwiftApps/tryswift/scripts/p2.swift 2013-09-10 20:33:02 UTC (rev 7053)
@@ -0,0 +1,11 @@
+type file;
+
+app (file o) simulation ()
+{
+ simulate stdout=@filename(o);
+}
+
+foreach i in [0:9] {
+ file f <single_file_mapper; file=@strcat("output/sim_",i,".out")>;
+ f = simulation();
+}
Added: SwiftApps/tryswift/scripts/p3.swift
===================================================================
--- SwiftApps/tryswift/scripts/p3.swift (rev 0)
+++ SwiftApps/tryswift/scripts/p3.swift 2013-09-10 20:33:02 UTC (rev 7053)
@@ -0,0 +1,27 @@
+type file;
+
+app (file o) simulation (int sim_steps, int sim_range, int sim_values)
+{
+ simulate "--timesteps" sim_steps "--range" sim_range "--nvalues" sim_values stdout=@filename(o);
+}
+
+app (file o) analyze (file s[])
+{
+ stats @filenames(s) stdout=@filename(o);
+}
+
+int nsim = @toInt(@arg("nsim","10"));
+int steps = @toInt(@arg("steps","1"));
+int range = @toInt(@arg("range","100"));
+int values = @toInt(@arg("values","5"));
+
+file sims[];
+
+foreach i in [0:nsim-1] {
+ file simout <single_file_mapper; file=@strcat("output/sim_",i,".out")>;
+ simout = simulation(steps,range,values);
+ sims[i] = simout;
+}
+
+file stats<"output/average.out">;
+stats = analyze(sims);
Added: SwiftApps/tryswift/scripts/p4.swift
===================================================================
--- SwiftApps/tryswift/scripts/p4.swift (rev 0)
+++ SwiftApps/tryswift/scripts/p4.swift 2013-09-10 20:33:02 UTC (rev 7053)
@@ -0,0 +1,29 @@
+type file;
+
+app (file out, file log) simulation (int sim_steps, int sim_range, int sim_values)
+{
+ simulate "--timesteps" sim_steps "--range" sim_range "--nvalues" sim_values stdout=@out stderr=@log;
+}
+
+app (file out, file log) analyze (file s[])
+{
+ stats @filenames(s) stdout=@out stderr=@log;
+}
+
+int nsim = @toInt(@arg("nsim", "10"));
+int steps = @toInt(@arg("steps", "1"));
+int range = @toInt(@arg("range", "100"));
+int values = @toInt(@arg("values", "5"));
+
+file sims[];
+
+foreach i in [0:nsim-1] {
+ file simout <single_file_mapper; file=@strcat("output/sim_",i,".out")>;
+ file simlog <single_file_mapper; file=@strcat("output/sim_",i,".log")>;
+ (simout,simlog) = simulation(steps,range,values);
+ sims[i] = simout;
+}
+
+file stats_out<"output/average.out">;
+file stats_log<"output/average.log">;
+(stats_out, stats_log) = analyze(sims);
Added: SwiftApps/tryswift/scripts/p5.swift
===================================================================
--- SwiftApps/tryswift/scripts/p5.swift (rev 0)
+++ SwiftApps/tryswift/scripts/p5.swift 2013-09-10 20:33:02 UTC (rev 7053)
@@ -0,0 +1,29 @@
+type file;
+
+app (file out, file log) simulation (int sim_steps, int sim_range, int sim_values)
+{
+ simulate "--timesteps" sim_steps "--range" sim_range "--nvalues" sim_values stdout=@out stderr=@log;
+}
+
+app (file out, file log) analyze (file s[])
+{
+ stats @filenames(s) stdout=@out stderr=@log;
+}
+
+int nsim = @toInt(@arg("nsim", "10"));
+int steps = @toInt(@arg("steps", "1"));
+int range = @toInt(@arg("range", "100"));
+int values = @toInt(@arg("values", "5"));
+
+file sims[];
+
+foreach i in [0:nsim-1] {
+ file simout <single_file_mapper; file=@strcat("output/sim_",i,".out")>;
+ file simlog <single_file_mapper; file=@strcat("output/sim_",i,".log")>;
+ (simout,simlog) = simulation(steps,range,values);
+ sims[i] = simout;
+}
+
+file stats_out<"output/average.out">;
+file stats_log<"output/average.log">;
+(stats_out, stats_log) = analyze(sims);
Added: SwiftApps/tryswift/scripts/p6.swift
===================================================================
--- SwiftApps/tryswift/scripts/p6.swift (rev 0)
+++ SwiftApps/tryswift/scripts/p6.swift 2013-09-10 20:33:02 UTC (rev 7053)
@@ -0,0 +1,57 @@
+type file;
+
+# app() functions for application programs to be called:
+
+app (file out) genseed (int nseeds)
+{
+ genseed "-r" 2000000 "-n" nseeds stdout=@out;
+}
+
+app (file out) genbias (int bias_range, int nvalues)
+{
+ genbias "-r" bias_range "-n" nvalues stdout=@out;
+}
+
+app (file out, file log) simulation (int timesteps, int sim_range,
+ file bias_file, int scale, int sim_count)
+{
+ simulate "-t" timesteps "-r" sim_range "-B" @bias_file "-x" scale
+ "-n" sim_count stdout=@out stderr=@log;
+}
+
+app (file out, file log) analyze (file s[])
+{
+ stats @filenames(s) stdout=@out stderr=@log;
+}
+
+# Command line arguments
+
+int nsim = @toInt(@arg("nsim", "10")); # number of simulation programs to run
+int steps = @toInt(@arg("steps", "1")); # number of timesteps (seconds) per simulation
+int range = @toInt(@arg("range", "100")); # range of the generated random numbers
+int values = @toInt(@arg("values", "10")); # number of values generated per simulation
+
+# Main script and data
+
+tracef("\n*** Script parameters: nsim=%i range=%i num values=%i\n\n", nsim, range, values);
+
+file seedfile<"output/seed.dat">; # Dynamically generated bias for simulation ensemble
+seedfile = genseed(1);
+
+int seedval = readData(seedfile);
+tracef("Generated seed=%i\n", seedval);
+
+file sims[]; # Array of files to hold each simulation output
+
+foreach i in [0:nsim-1] {
+ file biasfile <single_file_mapper; file=@strcat("output/bias_",i,".dat")>;
+ file simout <single_file_mapper; file=@strcat("output/sim_",i,".out")>;
+ file simlog <single_file_mapper; file=@strcat("output/sim_",i,".log")>;
+ biasfile = genbias(1000, 20);
+ (simout,simlog) = simulation(steps, range, biasfile, 1000000, values);
+ sims[i] = simout;
+}
+
+file stats_out<"output/average.out">;
+file stats_log<"output/average.log">;
+(stats_out,stats_log) = analyze(sims);
Deleted: SwiftApps/tryswift/scripts/parameter.swift
===================================================================
--- SwiftApps/tryswift/scripts/parameter.swift 2013-09-10 19:41:45 UTC (rev 7052)
+++ SwiftApps/tryswift/scripts/parameter.swift 2013-09-10 20:33:02 UTC (rev 7053)
@@ -1,8 +0,0 @@
-type messagefile;
-
-app (messagefile t) greeting (string s) {
- echo s stdout=@filename(t);
-}
-
-messagefile outfile <"parameter.hello.txt">;
-outfile = greeting("hello world");
Deleted: SwiftApps/tryswift/scripts/regexp_mapper.swift
===================================================================
--- SwiftApps/tryswift/scripts/regexp_mapper.swift 2013-09-10 19:41:45 UTC (rev 7052)
+++ SwiftApps/tryswift/scripts/regexp_mapper.swift 2013-09-10 20:33:02 UTC (rev 7053)
@@ -1,16 +0,0 @@
-type messagefile;
-type countfile;
-
-app (countfile t) countwords (messagefile f) {
- wc "-w" @filename(f) stdout=@filename(t);
-}
-
-messagefile inputfile <"regexp_mapper.words.txt">;
-
-countfile c <regexp_mapper;
- source=@inputfile,
- match="(.*)txt",
- transform="\\1count">;
-
-c = countwords(inputfile);
-
Deleted: SwiftApps/tryswift/scripts/restart.swift
===================================================================
--- SwiftApps/tryswift/scripts/restart.swift 2013-09-10 19:41:45 UTC (rev 7052)
+++ SwiftApps/tryswift/scripts/restart.swift 2013-09-10 20:33:02 UTC (rev 7053)
@@ -1,24 +0,0 @@
-type file;
-
-app (file f) touch() {
- touch @f;
-}
-
-app (file f) processL(file inp) {
- echo "processL" stdout=@f;
-}
-
-app (file f) processR(file inp) {
- broken "process" stdout=@f;
-}
-
-app (file f) join(file left, file right) {
- echo "join" @left @right stdout=@f;
-}
-
-file f = touch();
-
-file g = processL(f);
-file h = processR(f);
-
-file i = join(g,h);
Deleted: SwiftApps/tryswift/scripts/sequential_iteration.swift
===================================================================
--- SwiftApps/tryswift/scripts/sequential_iteration.swift 2013-09-10 19:41:45 UTC (rev 7052)
+++ SwiftApps/tryswift/scripts/sequential_iteration.swift 2013-09-10 20:33:02 UTC (rev 7053)
@@ -1,18 +0,0 @@
-type counterfile;
-
-app (counterfile t) echo(string m) {
- echo m stdout=@filename(t);
-}
-
-app (counterfile t) countstep(counterfile i) {
- wcl @filename(i) @filename(t);
-}
-
-counterfile a[] <simple_mapper;prefix="sequential_iteration.foldout">;
-
-a[0] = echo("793578934574893");
-
-iterate v {
- a[v+1] = countstep(a[v]);
- trace("extract int value ", at extractint(a[v+1]));
-} until (@extractint(a[v+1]) <= 1);
Deleted: SwiftApps/tryswift/scripts/sleep.swift
===================================================================
--- SwiftApps/tryswift/scripts/sleep.swift 2013-09-10 19:41:45 UTC (rev 7052)
+++ SwiftApps/tryswift/scripts/sleep.swift 2013-09-10 20:33:02 UTC (rev 7053)
@@ -1,9 +0,0 @@
-type file;
-
-app sleep (int s) {
- sleep s;
-}
-
-foreach f in [1:5] {
- sleep(30);
-}
Deleted: SwiftApps/tryswift/scripts/types.swift
===================================================================
--- SwiftApps/tryswift/scripts/types.swift 2013-09-10 19:41:45 UTC (rev 7052)
+++ SwiftApps/tryswift/scripts/types.swift 2013-09-10 20:33:02 UTC (rev 7053)
@@ -1,20 +0,0 @@
-type messagefile;
-
-type details {
- string name;
- int pies;
-}
-
-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;
-
-person.name = "John";
-person.pies = 3;
-
-messagefile outfile <"types.pies.txt">;
-
-outfile = greeting(person);
-
More information about the Swift-commit
mailing list