How do foldl and foldr work, broken down in an example?
问题 Okay, I am new with scheme/racket/lisp. I am practicing creating my own functions, syntax, and recursion, so I want to make my own foldl and foldr functions that do exactly what the predefined versions do. I can't do it because I just don't understand how these functions work. I have seen similar questions on here but I still don't get it. Some examples broken down would help! Here is my (incorrect) process: (foldl - 0 '(1 2 3 4)) I do 0 -(4-3-2-1) and get 2 which is the right answer (foldl -