fold

one of the documented procedures in this installation of the ACS
Usage:
fold   f   e   xs
What it does:
takes a binary function f, a start element e and a list {x1 x2 ...} and returns f (...(f (f (f e x1) x2) x3)...)
Defined in: /web/philip/tcl/ad-functional.tcl

Source code:


    set result $e
    foreach x $xs {
	set result [eval_binary $f $result $x]
    }
    return $result


philg@mit.edu