Christophe
Weblog
Wiki
Code
Publications
Music
projects
/
swankr.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
7845155
)
implement new slimefun swank:lookup-and-save-presented-object-or-lose
author
Christophe Rhodes
<csr21@cantab.net>
Sun, 20 Apr 2014 19:43:31 +0000
(20:43 +0100)
committer
Christophe Rhodes
<csr21@cantab.net>
Sun, 20 Apr 2014 19:43:31 +0000
(20:43 +0100)
For better presentations
swank-presentations.R
patch
|
blob
|
history
diff --git
a/swank-presentations.R
b/swank-presentations.R
index 6ac0e75af1dd190a0998ec8d3d689c03bc3e1b6d..69488cfa9dd7f954b60d1bbd0d9012e979db18c7 100644
(file)
--- a/
swank-presentations.R
+++ b/
swank-presentations.R
@@
-4,6
+4,8
@@
savePresentedObject <- function(slimeConnection, value) {
if(!exists("idToObject", envir=slimeConnection)) {
assign("idToObject", new.env(), envir=slimeConnection)
}
if(!exists("idToObject", envir=slimeConnection)) {
assign("idToObject", new.env(), envir=slimeConnection)
}
+ ## FIXME this should check for value already being present in the
+ ## idToObject map
presentationCounter <<- presentationCounter + 1
assign(as.character(presentationCounter), value, envir=slimeConnection$idToObject)
presentationCounter
presentationCounter <<- presentationCounter + 1
assign(as.character(presentationCounter), value, envir=slimeConnection$idToObject)
presentationCounter
@@
-43,7
+45,12
@@
sendReplResultFunction <- presentReplResult
stop(sprintf("attempt to access unrecorded object (id %d)", id))
}
}
stop(sprintf("attempt to access unrecorded object (id %d)", id))
}
}
-
+
+`swank:lookup-and-save-presented-object-or-lose` <- function(slimeConnection, sldbState, id) {
+ obj <- `swank:lookup-presented-object-or-lose`(slimeConnection, sldbState, id)
+ savePresentedObject(slimeConnection, obj)
+}
+
`swank:clear-repl-results` <- function(slimeConnection, sldbState) {
if(!exists("idToObject", envir=slimeConnection)) {
assign("idToObject", new.env(), envir=slimeConnection)
`swank:clear-repl-results` <- function(slimeConnection, sldbState) {
if(!exists("idToObject", envir=slimeConnection)) {
assign("idToObject", new.env(), envir=slimeConnection)