From: Alan P. <ap...@re...> - 2003-06-16 21:21:12
|
In article <Pin...@ea...>, Brian Hurt wrote: > On Mon, 16 Jun 2003, Alan Post wrote: >> >> Why not simply provide "fold" which does a fold_left, and put in a >> comment that the user should reverse the list arg if she really wants >> a fold_right? As you said, it isn't possible to walk a list >> backwards, so why pretend? > > The short answer is that the standard library provides a fold_right, > rightly or wrongly. If we're angling to replace the standard libraries, > we need to not break any code that depends on them. Adding functions is > OK, deleting functions I'd approach with great trepidation. That sounds sensible to me. How about doing the compatible thing, then, using the stack-gobbling approach the existing library uses, and putting in a comment that the user should avoid this function. |