ESS assigns .Last.value to the wrong place in R

David Brahm brahm at alum.mit.edu
Tue Aug 5 19:17:30 CEST 2003


If 5.2.0 is in the works (as Tony says), I'd like to repeat my ESS bug report
of 11/15/01 (and 2/26/02).  My ESS version is "irrevocably fixed", so I don't
actually know if it is still a bug under the new (namespace-driven) R; could
someone please check this example in the latest unpatched versions?

R> find(".Last.value")
   [1] "package:base"
R> 0+1
   [1] 1
R> .Last.value
   [1] 1
R> ?seq       # At this point a stale copy of .Last.value is written to pos=1
R> 0+2
   [1] 2
R> .Last.value                                        # WHOOPS!  WRONG VALUE!
   [1] 1
R> find(".Last.value")          # The right value is masked by the stale copy
   [1] ".GlobalEnv"   "package:base"

The bug is in essd-r.el, lines 63-64:

    (ess-retr-lastvalue-command
     . ".Last.value <- get(\".ess.lvsave\",inherits=TRUE)\n") ; envir=1

which should be changed (as I have done on my machine) to:

    (ess-retr-lastvalue-command
     . "assign(\".Last.value\", .ess.lvsave, envir=NULL)\n") ; package:base

Rich, Kurt, and Rodney weighed in at our last discussion, but it basically
ended with Kurt suggesting we wait for namespaces.  Well, they're here!
-- 
                              -- David Brahm (brahm at alum.mit.edu)




More information about the ESS-help mailing list