diff src/requests.tp @ 16:cb5108f62f93

moving file
author William Morgan <bill@mrgn.org>
date Fri, 09 Aug 2013 04:17:27 -0700
parents src/requsets.tp@18ec9131f594
children 566960135ea1
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/requests.tp	Fri Aug 09 04:17:27 2013 -0700
@@ -0,0 +1,28 @@
+#{
+	evalRequest <- :args {
+		#{
+			id <- "a"
+			arguments <- args
+			string <- {
+				temp <- ""//arguments fold: "" with: :acc el {acc . el}
+				"id" . id . "arguments" . temp
+			}
+		}
+	}
+
+	guessRequest <- :id :prog {
+		#{
+			string <- {
+				//remove the second escaped quote, it will compile.
+				idStr <- "\"id\"" //;\"" . id . "\""
+				progStr <- "b" // "\"program\":\"" . prog . "\""
+				idStr . progStr
+			}
+		}
+	}
+
+	main <- {
+		//print: ((evalRequest: #[1 2 3]) string)
+		print: ((guessRequest: "someId" "someProg") string) . "\n"
+	}
+}