Alaric Snell-Pym scripsit: > Which led me to wonder if we should have string-fold, list-fold, > vector-fold, and so on; then provide HOFs that accept a "folder" and > do all the generic sequence operations in terms of that.
It's out there. SRFI 1 provides left and right list fold and unfold, and left and right pair-fold, which apply to successive sublists rather than successive elements. SRFI-13 provides left and right string fold and unfold. SRFI-43 provides left and right vector fold but not unfold. SRFI-37 is a command-line arguments processor called args-fold that bends the notion of folding somewhat, but is still more like folding than mapping. SRFI-44 provides left and right folds for generic collections. (SRFI 1 has 22 implementations out of 28; SRFI 13 has 15 implementations; SRFI 43 has 11 implementations, as does SRFI 37; SRFI 44 has only one.) -- John Cowan [email protected] http://ccil.org/~cowan Female celebrity stalker, on a hot morning in Cairo: "Imagine, Colonel Lawrence, ninety-two already!" El Auruns's reply: "Many happy returns of the day!" _______________________________________________ r6rs-discuss mailing list [email protected] http://lists.r6rs.org/cgi-bin/mailman/listinfo/r6rs-discuss
