I tried doing this:
#lang scheme
(module duck scheme/base
(provide num-eggs quack)
(define num-eggs 2)
(define (quack n)
(unless (zero? n)
(printf "quack\n")
(quack (sub1 n)))))
But I get this error:
module: illegal use (not at top-level) in:
(module duck scheme/base (provide num-eggs quack) (define num-eggs 2) (define (quack n) (unless (zero? n) (printf "quack\n") (quack (sub1 n)))))
what is the correct way?