From: Johann Hibschman Date: 2000-11-14T17:40:01+09:00 Subject: [ruby-talk:6350] Re: Another Smalltalk control structure idea Conrad Schneiker/Austin/Contr/IBM writes: > Anyone know what the equivalent function is called in Mathematica? Maple?=20 > MathCAD? ? (Or in CLOS/Lisp/Scheme? Or Haskell?) Common Lisp uses "reduce." In Scheme, I'm used to seeing this named "fold-left" or "foldl" (or "fold-right" or "foldr", if the other way.) (fold-left f x0 '(x1 x2 x3)) = (f (f (f x0 x1) x2) x3) (fold-right f x0 '(x1 x2 x3)) = (f x1 (f x2 (f x3 x0))) Mathmatica, I forget. I always liked reduce, myself; Common lisp has the advantage that it can take the :from-end t keyword to get the alternate behavior. --J -- Johann Hibschman johann@physics.berkeley.edu