]> rhodes.io Git - swankr.git/commitdiff
Christophe Weblog Wiki Code Publications Music
make inspector printing more reasonable
authorChristophe Rhodes <csr21@cantab.net>
Tue, 1 May 2012 14:20:25 +0000 (15:20 +0100)
committerChristophe Rhodes <csr21@cantab.net>
Tue, 1 May 2012 14:20:25 +0000 (15:20 +0100)
I don't yet know what's right, but it's fairly nonsensical to have
"[1] " prepending every label and value, so use prin1ToString

swank.R

diff --git a/swank.R b/swank.R
index 3b1f3d78ad29910f51034574f73470ffe6fdd123..59686299ec29b887d015e7d9c4fee76b8fe6ba04 100644 (file)
--- a/swank.R
+++ b/swank.R
@@ -658,7 +658,7 @@ inspectObject <- function(slimeConnection, object) {
 
 valuePart <- function(istate, object, string) {
   list(quote(`:value`),
-       if(is.null(string)) printToString(object) else string,
+       if(is.null(string)) prin1ToString(object) else string,
        assignIndexInParts(object, istate))
 }
 
@@ -669,7 +669,7 @@ preparePart <- function(istate, part) {
     switch(as.character(part[[1]]),
            `:newline` = list("\n"),
            `:value` = valuePart(istate, part[[2]], part[[3]]),
-           `:line` = list(printToString(part[[2]]), ": ",
+           `:line` = list(prin1ToString(part[[2]]), ": ",
              valuePart(istate, part[[3]], NULL), "\n"))
   }
 }