Commit dc22b346 authored by Christophe Rhodes's avatar Christophe Rhodes
Browse files

deal with 0 or multiple expressions at the repl

It's easy really; just iterate over expressions.  Resolves bug #10.
parent 76176a55
......@@ -31,7 +31,7 @@
* OPEN #9 help and ? to produce help buffers :WISHLIST:
Not like ESS, though: that works by looking at the user's input with
a regexp. Use slime-media?
* OPEN #10 0 or more than 1 exprs at REPL :MINOR:
* RESOLVED #10 0 or more than 1 exprs at REPL :MINOR:FIXED:
Entering 0 exprs (whitespace or the empty string) at the REPL gives
an error from `swank:listener-eval`, which subscripts the parse tree
with index 1. (Entering more than one simply ignores all after the
......
......@@ -324,12 +324,14 @@ sendReplResultFunction <- sendReplResult
`swank:listener-eval` <- function(slimeConnection, sldbState, string) {
## O how ugly
string <- gsub("#\\.\\(swank:lookup-presented-object-or-lose([^)]*)\\)", ".(`swank:lookup-presented-object-or-lose`(slimeConnection, sldbState,\\1))", string)
expr <- parse(text=string)[[1]]
## O maybe this is even uglier
lookedup <- do.call("bquote", list(expr))
tmp <- withVisible(eval(lookedup, envir = globalenv()))
if(tmp$visible) {
sendReplResultFunction(slimeConnection, tmp$value)
for(expr in parse(text=string)) {
expr <- expr
## O maybe this is even uglier
lookedup <- do.call("bquote", list(expr))
tmp <- withVisible(eval(lookedup, envir = globalenv()))
if(tmp$visible) {
sendReplResultFunction(slimeConnection, tmp$value)
}
}
list()
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment