}
startSwank <- function(portFile) {
- acceptConnections(FALSE, portFile)
+ acceptConnections(4005, portFile)
}
acceptConnections <- function(port, portFile) {
+ if(portFile != FALSE) {
+ f <- file(portFile, open="w+")
+ cat(port, file=f)
+ close(f)
+ }
s <- socketConnection(host="localhost", server=TRUE, port=port, open="r+b")
on.exit(close(s))
serve(s)
list(output, prin1ToString(value))
}
+`swank:interactive-eval-region` <- function(slimeConnection, sldbState, string) {
+ withRetryRestart("retry SLIME interactive evaluation request",
+ value <- eval(parse(text=string), envir=globalenv()))
+ prin1ToString(value)
+}
+
`swank:find-definitions-for-emacs` <- function(slimeConnection, sldbState, string) {
if(exists(string, envir = globalenv())) {
thing <- get(string, envir = globalenv())