view functional.rhope @ 87:3c4325e6298f

Add First@Dictionary (need to find mem man bug)
author Mike Pavone <pavone@retrodev.com>
date Fri, 30 Jul 2010 01:48:59 -0400
parents 004f0fc8941f
children 6d41b71f1b77
line wrap: on
line source


_Fold[list,index,current,worker:out]
{
	newval <- [worker]Call[current, [list]Index[index], index]
	
	[list]Next[index]
	{
		out <- _Fold[list, ~, newval, worker]
	}{
		out <- Val[newval]
	}
}

Fold[worker,start,list:out]
{
	[list]First
	{
		out <- _Fold[list, ~, start, worker]
	}{
		out <- start
	}
}