[Sciviews-commits] r459 - pkg/svSocket/R

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Thu Mar 29 21:49:13 CEST 2012


Author: phgrosjean
Date: 2012-03-29 21:49:13 +0200 (Thu, 29 Mar 2012)
New Revision: 459

Modified:
   pkg/svSocket/R/evalServer.R
Log:
Further changes in svSocket's evalServer()

Modified: pkg/svSocket/R/evalServer.R
===================================================================
--- pkg/svSocket/R/evalServer.R	2012-03-29 08:26:48 UTC (rev 458)
+++ pkg/svSocket/R/evalServer.R	2012-03-29 19:49:13 UTC (rev 459)
@@ -8,11 +8,11 @@
 	## Robust flushing and dumping is just for windows. Linux is probably fine
 	## without but no harm to leave in for now since binary mode will moot this.
 	x <- substitute(expr)
-	if (!missing(send) && (!length(x) == 1 || mode(x) != "name"))
+	if (!missing(send) && (length(x) != 1 || mode(x) != "name"))
 		stop("When send is supplied, expr must be a target variable name (unquoted) on the server to assign the result of the send expr to.")
 	if (!is.character(x)) x <- deparse(x)
 
-	readLines(con)  # Flush input stream just incase previous call failed to clean up.
+	readLines(con)  # Flush input stream just in case previous call failed to clean up
 	if (missing(send)) {
 		cat('..Last.value <- try(eval(parse(text = "', x,
 			'"))); .f <- file(); dump("..Last.value", file = .f); flush(.f); seek(.f, 0); cat("\\n<<<startflag>>>", readLines(.f), "<<<endflag>>>\\n", sep = "\\n"); close(.f); rm(.f, ..Last.value); flush.console()\n',
@@ -46,11 +46,11 @@
 		endloc <- grep("<<<endflag>>>", obj)
 		if (length(endloc)) obj <- obj[0:(endloc[length(endloc)] - 1)]
 		## This is more robust than paste'ing together a potentially very
-		## large single string.
+		## large single string
 		objdump <- c(objdump, obj)
 	}
 	if (!missing(send)) {
-		if (!all(objdump == "")) stop("You should send somethings")
+		if (!all(objdump == "")) stop(objdump)
 		return(TRUE)
 	}
 	startloc <- grep("<<<startflag>>>", objdump)



More information about the Sciviews-commits mailing list