macros and module-environment added by caolanm on Tue Jun 7 09:54:51 2016

;; example.scm

(module example *

(import chicken scheme)

(define (add a b) (+ a b))

(define-syntax double
  (syntax-rules ()
    ((_ x) (add x x))))

)


;; run.scm

(load "./example.scm")
(import example)

(print (eval '(double 10) (module-environment 'example)))



;; Running the above results in:
;; Error: unbound variable: add43