Racket module contract confuse me <p>the module: test-define.rkt</p> <pre><code>#lang racket (provide test) (provide (contract-out [add-test! (-&gt; void)])) (define test 0) (define (add-test!) (set! test (add1 test))) </code></pre> <p>the main program:act.rkt</p> <pre><code>#lang racket (require "test-define.rkt") (printf "~a~%" test) (add-test!) (printf "~a~%" test) </code></pre> <p>run the act.rkt, I get:</p> <pre><code>0 1 </code></pre> <p>this is what I want.</p> <p>But if I change the contract in test-define.rkt:</p> <pre><code>(provide test) </code></pre> <p>change to </p> <pre><code>(provide (contract-out [test integer?])) </code></pre> <p>then I run the act.rkt again, I get:</p> <pre><code>0 0 </code></pre> <p>Why? I can't change the test value.</p> <p>If I provide a get func, it turns normal again.</p> <pre><code>(provide (contract-out [get-test (-&gt; integer?)])) (define (get-test) test) </code></pre> <p>If test's type change to hash map, it's always normal.</p> <p>What I missed?</p>