view testnworker.rhope @ 189:d0e3a13c1bd9 default tip

Remove old calculator example
author Mike Pavone <pavone@retrodev.com>
date Fri, 07 Oct 2011 00:24:04 -0700
parents c6ba9fe45910
children
line wrap: on
line source

Import nworker.rhope

Test NWorker[:out]
{
	ref+ <- Worker Ref["+","rhope",2,1,Yes]
	ref* <- Worker Ref["*","rhope",2,1,Yes]
	,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
	]
}