Mercurial > repos > rhope
diff functional.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 | e73a93fb5de1 |
children | f4fc0a98088a |
line wrap: on
line diff
--- a/functional.rhope Tue Aug 03 22:38:25 2010 -0400 +++ b/functional.rhope Tue Aug 03 23:51:39 2010 -0400 @@ -91,3 +91,36 @@ } } +_Zip[left,lindex,right,rindex,outlist:out] +{ + nlist <- [outlist]Append[ + [[()]Append[ [left]Index[lindex] ]]Append[ [right]Index[rindex] ] + ] + nlindex <- [left]Next[lindex] + { + [right]Next[rindex] + { + out <- _Zip[left,nlindex,right,~,nlist] + }{ + out <- Val[nlist] + } + }{ + out <- Val[nlist] + } +} + +Zip[left,right:out] +{ + lindex <- [left]First + { + [right]First + { + out <- _Zip[left,lindex,right,~,()] + }{ + out <- () + } + }{ + out <- () + } +} +