]> rhodes.io Git - swankr.git/commitdiff
Christophe Weblog Wiki Code Publications Music
A proper implementation of swank:swank-require
authorChristophe Rhodes <csr21@cantab.net>
Mon, 30 Aug 2010 20:45:48 +0000 (21:45 +0100)
committerChristophe Rhodes <csr21@cantab.net>
Mon, 30 Aug 2010 20:45:48 +0000 (21:45 +0100)
We can do this nicely now that we have an evaluator of :emacs-rex
forms that can cope with quote.

swank.R

diff --git a/swank.R b/swank.R
index b9d89cbc6959c37b59a0e2c16ec7d064ee677a7b..e6e78c7e15996168ad9db03c1ab154c3d2dd9b9e 100644 (file)
--- a/swank.R
+++ b/swank.R
@@ -259,6 +259,12 @@ printToString <- function(val) {
 }
 
 `swank:swank-require` <- function (slimeConnection, sldbState, contribs) {
+  for(contrib in contribs) {
+    filename <- sprintf("%s.R", as.character(contrib))
+    if(file.exists(filename)) {
+      source(filename, verbose=TRUE)
+    }
+  }
   list()
 }