summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Thompson <dthompson2@worcester.edu>2015-10-12 19:29:57 -0400
committerDavid Thompson <dthompson2@worcester.edu>2015-10-12 19:29:57 -0400
commitec79e5ad1f9614038575989e96e9f5c075a33efe (patch)
tree82aa61c01bb70639c16d24cb10c7fbfe4bcce73a
parent288913eff2fc308354a373c39463e48bb879ea91 (diff)
utils: Add make-user-module.
* haunt/utils.scm (make-user-module): New procedure.
-rw-r--r--haunt/utils.scm11
1 files changed, 10 insertions, 1 deletions
diff --git a/haunt/utils.scm b/haunt/utils.scm
index 5fd97c7..29e6ef2 100644
--- a/haunt/utils.scm
+++ b/haunt/utils.scm
@@ -38,7 +38,8 @@
delete-file-recursively
mkdir-p
string->date*
- take-up-to))
+ take-up-to
+ make-user-module))
(define* (flatten lst #:optional depth)
"Return a list that recursively concatenates the sub-lists of LST,
@@ -146,3 +147,11 @@ are fewer than N elements."
(() '())
((head . tail)
(cons head (take-up-to (1- n) tail))))))
+
+(define (make-user-module modules)
+ "Return a new user module with the additional MODULES loaded."
+ (let ((module (make-fresh-user-module)))
+ (for-each (lambda (iface)
+ (module-use! module (resolve-interface iface)))
+ modules)
+ module))