From: Christophe Rhodes Date: Fri, 3 Sep 2010 16:03:08 +0000 (+0100) Subject: swank:value-for-editing and swank:commit-edited-value X-Git-Url: http://christophe.rhodes.io/gitweb/?a=commitdiff_plain;h=df9e80e09eb7639969fbcdb57899efe72688486b;p=swankr.git swank:value-for-editing and swank:commit-edited-value These are (in principle, at least) really, really easy. --- diff --git a/swank.R b/swank.R index 0a309ef..488ad56 100644 --- 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 +}