Following the instructions in http://www.scheme.com/csug8/libraries.html, I could build a library smcho.ss.
(library (smcho simple (1))
(export hello factorial)
(import (rnrs (6)))
(define (hello x)
(+ x 10))
(define (factorial n)
(cond
[(<= n 0) 1]
[else (* n (factorial (- n 1)))]))
)
Then, install it with plt-r6rs --install smcho.ss (http://lists.racket-lang.org/users/archive/2009-September/035465.html).
However, when I tried to use it in top_level.ss,
(import (smcho simple) (rnrs (6)))
(print (factorial 10))
I have error messages
scheme> plt-r6rs top_level.sc
get-module-code: no such file: #<path:/Users/smcho/Desktop/scheme_lib/top_level.sc>
context...:
What might be wrong?
I checked that the ~/Library/Racket/6.3/collects directory stores correctly compiled library, so the issue should not be from the library.