> 
> Even if you use define/contract, you may violate the contract on recursive
calls. This is intentional. 
> 

Thanks.

I hadn't run into that behavior before and wasn't aware. 

Could you possibly elaborate on the thinking wrt this design choice?

(define/contract (my-natural-number n)
  (-> exact-positive-integer? any/c)
  (print n) (newline)
  (my-natural-number (sub1 n)))

(my-natural-number 1)
1
0
-1
-2
-3
-4



____________________
  Racket Users list:
  http://lists.racket-lang.org/users

Reply via email to