I had to do some digging, but I finally figured out how to do this.
According to the wiki, if you have file bar.scm
, which is relied upon file foo.scm
, here's how you, essentially, #include
bar.scm
in foo.scm
:
;;; bar.scm
; The declaration marks this source file as the bar unit. The names of the
; units and your files don't need to match.
(declare (unit bar))
(define (fac n)
(if (zero? n)
1
(* n (fac (- n 1))) ) )
;;; foo.scm
; The declaration marks this source file as dependant on the symbols provided
; by the bar unit:
(declare (uses bar))
(write (fac 10)) (newline)
Placing (declare (unit helper))
in helper.scm
and (declare (uses helper))
in main.scm
and compiling them thusly, worked:
csc -c main.scm -o main.o
csc -c helper.scm -o helper.o
csc -o foobar main.o helper.o