Hi folks,
I just wanted to check my thinking before I began a fool's errand that
would be hard to back out of. I have a small application which runs as
a interpreter script. The script, script.scm, depends on script-lib.scm,
which in turn depends on misc.scm.
I'd like to compile the script, but for debugging purposes I'd still
like to be able to run it in an interpreter. To that end, I've
considered adding declarations like this to my source files:
;; script.scm
(eval-when (eval) (use script-lib))
(eval-when (load) (declare (uses script-lib)))
;; script-lib.scm
(eval-when (eval) (use misc))
(eval-when (load) (declare (unit script-lib) (uses misc)))
;; misc.scm
(eval-when (load) (declare (unit misc)))
It's feasible, I think, but it seems rather cumbersome. Is there a
simpler idiom for keeping the script interpretable, but still
preparing it for compilation? I feel like I'm missing something obvious...