diff options
| author | Rose Hogenson <rhogenson@posteo.net> | 2022-07-26 19:24:10 -0700 |
|---|---|---|
| committer | Rose Hogenson <rhogenson@posteo.net> | 2022-07-26 19:24:10 -0700 |
| commit | becfaeb778a3c8ba241e2155b998d6b27dcfad0c (patch) | |
| tree | 97ca02178660fe958026a707905eac1c5ebd188d /csc/test-main.csc | |
| parent | Fix an issue with how the linker combined files. (diff) | |
| download | chromatopelma-becfaeb778a3c8ba241e2155b998d6b27dcfad0c.tar.zst | |
Fix a potential R7RS issue.
I was using the load procedure to load a program, but by a strict
reading of R7RS, load can only handle expressions and definitions, not
imports. So instead I'm defining each test as a library, and using the
environment procedure to load them at runtime.
Diffstat (limited to 'csc/test-main.csc')
| -rw-r--r-- | csc/test-main.csc | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/csc/test-main.csc b/csc/test-main.csc index 7b45883..184d069 100644 --- a/csc/test-main.csc +++ b/csc/test-main.csc @@ -1,6 +1,18 @@ (import (scheme base) - (only (csc testing) test-main)) + (only (csc testing) + test-main) + (only (scheme eval) + environment)) -(for-each load (cdr (command-line))) +(define (filename->library f) + (list 'csc (string->symbol (substring f 0 (- (string-length f) 4))))) + + +; Guile's load function allows import forms, but by a strict reading of R7RS, +; load can only handle expressions and definitions. I'm working around this by +; defining each test as a library, and using the environment procedure to load +; the libraries at runtime. Somehow this should be more portable. +(apply environment + (map filename->library (cdr (command-line)))) (test-main) |
