f::fold1 (public)

 f::fold1 f xs

Defined in packages/acs-tcl/tcl/ad-functional-procs.tcl

Takes a binary function f and a list {x1 x2 x3 ...} and returns (...(f (f (f x1 x2) x3) x4)...). "fold1" behaves like "fold", but does not take a start element and does not work for empty lists. Examples: f::fold1 min [list 3 1 4 1 5 9 2 6] = 1 f::fold1 max [list 3 1 4 1 5 9 2 6] = 9

Parameters:
f
xs
See Also:
  • fold1

Partial Call Graph (max 5 caller/called nodes):
%3 test_functional_api functional_api (test acs-tcl) f::fold1 f::fold1 test_functional_api->f::fold1 f::fold f::fold (public) f::fold1->f::fold f::head f::head (public) f::fold1->f::head f::null_p f::null_p (public) f::fold1->f::null_p f::tail f::tail (public) f::fold1->f::tail f::lmax f::lmax (public) f::lmax->f::fold1 f::lmin f::lmin (public) f::lmin->f::fold1

Testcases:
functional_api
[ show source ]
Show another procedure: