scanl

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

Source code:


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


philg@mit.edu