diff testnworker.rhope @ 98:a34a982ecd32

Broken port of nworker to compiler
author Mike Pavone <pavone@retrodev.com>
date Tue, 03 Aug 2010 23:51:39 -0400
parents
children e09c2d1d6d5b
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testnworker.rhope	Tue Aug 03 23:51:39 2010 -0400
@@ -0,0 +1,30 @@
+Import nworker_c.rhope
+
+Test NWorker[:out]
+{
+	ref+ <- Worker Ref["+","rhope",2,1]
+	ref* <- Worker Ref["*","rhope",2,1]
+	,a <- [NWorker["rhope"]
+	]Add Input["a", 0] {
+		,b <- [~]Add Input["b", 1] {
+		,c <- [~]Add Input["c", 2] {
+		,outref <- [~]Add Output["out", 0] {
+		,call+ <- [~]Add Worker Call[ref+] {
+		,call* <- [~]Add Worker Call[ref*] {
+		out <- [[[[[~]Add Wire[a,0,call+,0]
+		]Add Wire[b,0,call+,1]
+		]Add Wire[call+,0,call*,0]
+		]Add Wire[c,0,call*,1]
+		]Add Wire[call*,0,outref,0]
+	}}}}}}
+}
+
+Main[]
+{
+	Print[
+		[[[[NProgram]Register Builtins
+		]Bind Worker["Test", Test NWorker[]]
+		]Compile Program[C Program[]]
+		]Text
+	]
+}