title: Translating Python into Scheme/Racket
body: <p>I'm currently trying to translate this python 2 code:</p>
  
  <pre><code>import math
  
  def worstCaseArrayOfSize(n):
      if n == 1:
          return [1]
      else:
          top = worstCaseArrayOfSize(int(math.floor(float(n) / 2)))
          bottom = worstCaseArrayOfSize(int(math.ceil(float(n) / 2)))
          return map(lambda x: x * 2, top) + map(lambda x: x * 2 - 1, bottom)
  </code></pre>
  
  <p>into racket/scheme code, and having a difficult time.</p>
  
  <p>This is what I have so far:</p>
  
  <pre><code>(define (msortWorstCase n)
    (cond
      [(equal? 1 n) 1]
      [else (let* ([top (msortWorstCase(floor (/ n 2)))] [bottom (msortWorstCase (ceiling (/ n 2)))]) 
  
  (append (map (lambda (x) (* x 2)) (list top)) (map (lambda (x) (- (* x 2) 1)) (list bottom))))]
      )
    )
  </code></pre>
  
  <p>Could anyone tell me where I am going wrong with this?</p>
  
  <p>I am getting the following error:</p>
  
  <pre><code>*: contract violation
    expected: number?
    given: '(2 1)
    argument position: 1st
    other arguments...:
  </code></pre>
  
  <hr>