From 8d84cee073ab58c2c858a6aac994a4f88d91ddb4 Mon Sep 17 00:00:00 2001 From: Christophe Rhodes Date: Sat, 11 Sep 2010 10:58:10 +0100 Subject: [PATCH] implement swank:inspector-eval It took me quite some time to remember that parse returns a list of expressions rather than just a single expression... --- swank.R | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/swank.R b/swank.R index ce85b69..3ab65ee 100644 --- a/swank.R +++ b/swank.R @@ -576,3 +576,14 @@ emacsInspect.numeric <- function(numeric) { FALSE } } + +`swank:inspector-eval` <- function(slimeConnection, sldbState, string) { + expr <- parse(text=string)[[1]] + object <- slimeConnection$istate$object + if(inherits(object, "list")|inherits(object, "environment")) { + substituted <- substituteDirect(expr, object) + eval(substituted, envir=globalenv()) + } else { + eval(expr, envir=globalenv()) + } +} -- 2.39.5