title: How do foldl and foldr work, broken down in an example?
body: <p>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 <code>foldl</code> and <code>foldr</code> 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:</p>
  
  <p><code>(foldl - 0 '(1 2 3 4))</code> I do <code>0 -(4-3-2-1)</code> and get 2 which is the right answer</p>
  
  <p><code>(foldl - 0 '(4 3 2 1))</code> I do <code>0-(1-2-3-4)</code> and get 8 but it should be -2.</p>
  
  <p><code>(foldr - 0 '(1 2 3 4))</code> I do <code>0-(1-2-3-4)</code> and get 8 again, but it should be -2.</p>
  
  <p><code>(foldr - 0 '(4 3 2 1))</code> I do <code>0-(4-3-2-1)</code> and get 2 which is the right answer.</p>
  
  <p>What am I doing wrong?</p>