comparison 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
comparison
equal deleted inserted replaced
97:fa437d23bb24 98:a34a982ecd32
1 Import nworker_c.rhope
2
3 Test NWorker[:out]
4 {
5 ref+ <- Worker Ref["+","rhope",2,1]
6 ref* <- Worker Ref["*","rhope",2,1]
7 ,a <- [NWorker["rhope"]
8 ]Add Input["a", 0] {
9 ,b <- [~]Add Input["b", 1] {
10 ,c <- [~]Add Input["c", 2] {
11 ,outref <- [~]Add Output["out", 0] {
12 ,call+ <- [~]Add Worker Call[ref+] {
13 ,call* <- [~]Add Worker Call[ref*] {
14 out <- [[[[[~]Add Wire[a,0,call+,0]
15 ]Add Wire[b,0,call+,1]
16 ]Add Wire[call+,0,call*,0]
17 ]Add Wire[c,0,call*,1]
18 ]Add Wire[call*,0,outref,0]
19 }}}}}}
20 }
21
22 Main[]
23 {
24 Print[
25 [[[[NProgram]Register Builtins
26 ]Bind Worker["Test", Test NWorker[]]
27 ]Compile Program[C Program[]]
28 ]Text
29 ]
30 }