title: Scheme - Expects a non-empty list
body: <p>For reference I am programming with <code>Scheme</code> using <code>DrRacket</code>.</p>
  
  <p>When I run the program I get the following error message:</p>
  
  <pre><code>check-expect encountered the following error instead of the expected value, 
  (list false true true true). 
     :: first: expects a non-empty list; given: string?
  </code></pre>
  
  <p>I am not sure what the issue is, as it seems the code should run fine.</p>
  
  <pre><code>;; Signature: mymap: (x -&gt; y) listofX -&gt; listofY
  ;; Purpose: Consumes a function from X –&gt; Y, and a list of X; returns a list of Y;
  ;;          by applying the function to each item in the list of X.
  
  (define (mymap g alist)
    (cond
      [(empty? alist) empty]
      [else
       (cons (g (first alist))
             (mymap (rest alist) g))]
      )
    )
  
  ;; define 2 other functions using mymap and write
  ;; one check-expect for each of these functions
  
  (check-expect (mymap string? (list 1 "ab" "abc" "")) (list false true true true))
  (check-expect (mymap sqr (list 1 0 -3 4 -5)) (list 1 0 9 16 25))
  
  (define (C2F c)
    (+ (* 9/5 c) 32))
  
  (define (cf* alist)
    (mymap alist C2F))
  
  (check-expect (mymap C2F (list 100 0 -40)) (list 212 32 -40))
  </code></pre>
  
  <p>Thank you in advance!</p>