title: Iterating on elements of Scheme-vector causes contract violation
body: <p>I'm trying to write a function that checks if the given input holds any characters other than digits . However , I get <code>contract violation</code> in DrRacket under Scheme .</p>
  
  <p>Here's the code : </p>
  
  <p>A method that separating a string into characters :</p>
  
  <pre><code>(define (breaking str) (list-&gt;vector (string-&gt;list str)))
  </code></pre>
  
  <p>Creating a vector for the number :</p>
  
  <pre><code>(define myNumber (breaking "123498765")) 
  </code></pre>
  
  <p>Here I check the given number :</p>
  
  <pre><code>(define (vectorFunc myVector)
  (define i 0)                      
  (do ()                             
    ((= i (vector-length myVector))) ; run until the end of the vector
    (cond ((&lt; (vector-ref myVector i) #\0) 'incorrect)
          ((&gt; (vector-ref myVector i) #\9)  'also-incorrect))
    (set! i (+ i 1))    ; inc "i+ by 1
  ); end of do
  )
  </code></pre>
  
  <p>And the output of <code>(vectorFunc myNumber)</code> is : </p>
  
  <pre><code>. . &gt;: contract violation
    expected: real?
    given: #\1
    argument position: 1st
    other arguments...:
     #\0
  &gt; 
  </code></pre>
  
  <p>What's wrong with it ? </p>