Eval'ing imported functions pasted by misilver on Sun Oct 30 20:52:53 2016
;;; hello.scm (module hello (say-hello) (import chicken scheme) (define (say-hello) "hello")) ;;; goodbye.scm (module goodbye * (import chicken scheme) (use ports hello) (define (say-goodbye) "goodbye") (print (string-append (say-hello) (say-goodbye))) ; prints "hellogoodbye" ;; Fails because say-hello and say-goodbye are not defined in the eval ;; environment, which defaults to (interaction-environment). (print (eval (with-input-from-string "(string-append (say-hello) (say-goodbye))" read))) )
split into three files added by evhan on Sun Oct 30 21:19:32 2016
;;; hello.scm (module hello (say-hello) (import chicken scheme) (define (say-hello) "hello")) ;;; goodbye.scm (module goodbye * (import chicken scheme) (use ports hello) (define (say-goodbye) "goodbye")) ;;; usage.scm (eval '(use hello goodbye)) (print (eval '(string-append (say-hello) (say-goodbye))))