diff kernel.rhope @ 99:e09c2d1d6d5b

Got dataflow graph code working in compiler (nworker_c.rhope)
author Mike Pavone <pavone@retrodev.com>
date Fri, 06 Aug 2010 01:42:37 -0400
parents a34a982ecd32
children f51c4c17457c
line wrap: on
line diff
--- a/kernel.rhope	Tue Aug 03 23:51:39 2010 -0400
+++ b/kernel.rhope	Fri Aug 06 01:42:37 2010 -0400
@@ -16,6 +16,13 @@
 	Val(Int32,Naked)
 }
 
+String@Boolean[b:out]
+{
+	If[b]
+	{ out <- "Yes" }
+	{ out <- "No" }
+}
+
 /*
 Blueprint Blueprint
 {
@@ -208,9 +215,12 @@
 Get Input@Worker[worker(Worker),bindex(Int32):val,not populated]
 {
 	index <- [bindex]Trunc Int16
-	,not populated <- If[_internal_worker_hasinput[worker,index]]
+	,not populated <- If[[index]<[[worker]Size >>]]
 	{
-		val <- _internal_worker_getinput[worker,index]
+		,not populated <- If[_internal_worker_hasinput[worker,index]]
+		{
+			val <- _internal_worker_getinput[worker,index]
+		}
 	}
 }
 
@@ -233,6 +243,9 @@
 Set Input@Worker[worker(Worker),bindex(Int32),val:out(Worker)]
 {
 	index <- [bindex]Trunc Int16
+	[worker]Get Input[bindex]
+	{ newcount <- Count >>[worker] }
+	{ newcount <- [Count >>[worker]]+[1i16] }
 	If[[index] < [[worker]Size >>]]
 	{
 		set <- _internal_worker_setinput[worker, index, val]
@@ -243,7 +256,7 @@
 				, 0i16]
 			, index, val]
 	}
-	out <- [set]Count <<[ [[set]Count >>]+[1i16] ]
+	out <- [set]Count <<[newcount]
 }
 
 =@Blueprint[left,right:out]