title: Sum items in list Racket
body: <p>I'm working with simple lists in Racket, and I was doing a function to sum the elements of a list.</p>
  
  <p>But I would like to know if there is any simpler way to do this.</p>
  
  <p>I did this <strong>function</strong>:</p>
  
  <pre><code>(define (mySum L)
    (if (empty? L) 0
        (+ (first L) (mySum (rest L))))
    )
  </code></pre>
  
  <p><strong>output:</strong></p>
  
  <pre><code>(mySum '(1 2 3 4))
  10
  </code></pre>
  
  <p>I wanted to know if anyone knows a simpler way to do this. I explain myself, for example:
  This is another <strong>function</strong> I did:</p>
  
  <pre><code>(define (myAppend L1 L2)
    (if (empty? L1) L2
        (cons (car L1) (myAppend (cdr L1) L2)))
    )
  </code></pre>
  
  <p>But this function can be done more simply by doing just this:</p>
  
  <pre><code>(define (myAppend L1 L2)
    (append L1 L2)
    )
  </code></pre>
  
  <p>My <strong>problem</strong> is to know if there is a simpler way to do the sum of items in a list. Thanks</p>