aboutsummaryrefslogtreecommitdiffstats
path: root/lib/csc/compiler.csc
diff options
context:
space:
mode:
authorRose Hogenson <rhogenson@posteo.net>2022-08-01 19:37:49 -0700
committerRose Hogenson <rhogenson@posteo.net>2022-08-01 19:37:49 -0700
commit25750ee505bd976d3c606200fec7253ad40c46d9 (patch)
tree5984514f625db2f7fa01256adef4d3c7be2e3615 /lib/csc/compiler.csc
parentModify the project structure. (diff)
downloadchromatopelma-25750ee505bd976d3c606200fec7253ad40c46d9.tar.zst
Remove mutable globals.
Per a closer reading of R7RS, it's an error to mutate an imported binding with set!. My apologies to Guile when I said they had a bug.
Diffstat (limited to 'lib/csc/compiler.csc')
-rw-r--r--lib/csc/compiler.csc6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/csc/compiler.csc b/lib/csc/compiler.csc
index 20d5d37..7054f10 100644
--- a/lib/csc/compiler.csc
+++ b/lib/csc/compiler.csc
@@ -1,6 +1,6 @@
(define-library (csc compiler)
(export
- *library-search-dirs*
+ add-library-search-dirs
compile)
(import (scheme base)
(only (scheme file)
@@ -88,6 +88,10 @@
(define *library-search-dirs* '())
+ (define (add-library-search-dirs ds)
+ (set! *library-search-dirs* (append *library-search-dirs* ds)))
+
+
(define (find-library name)
(define library-roots (cons *standard-library-dir* *library-search-dirs*))
(loop for dir in library-roots