Christophe Weblog Wiki Code Publications Music
swank:value-for-editing and swank:commit-edited-value
authorChristophe Rhodes <csr21@cantab.net>
Fri, 3 Sep 2010 16:03:08 +0000 (17:03 +0100)
committerChristophe Rhodes <csr21@cantab.net>
Fri, 3 Sep 2010 16:03:08 +0000 (17:03 +0100)
These are (in principle, at least) really, really easy.

swank.R

diff --git a/swank.R b/swank.R
index 0a309ef..488ad56 100644 (file)
--- a/swank.R
+++ b/swank.R
@@ -448,3 +448,13 @@ computeRestartsForEmacs <- function (sldbState) {
     list()
   }
 }
+
+`swank:value-for-editing` <- function(slimeConnection, sldbState, string) {
+  paste(deparse(eval(parse(text=string), envir = globalenv()), control="all"),
+        collapse="\n", sep="")
+}
+
+`swank:commit-edited-value` <- function(slimeConnection, sldbState, string, value) {
+  eval(parse(text=sprintf("%s <- %s", string, value)), envir = globalenv())
+  TRUE
+}