Skip to content

the value of the last expression

3 messages · Sam Steingold, Richard M. Heiberger, R. Michael Weylandt

#
Is there an analogue of common lisp "*" variable which contains the
value of the last expression?
E.g., in lisp:
3
3

I wish I could recover the value of the last expression without
re-evaluating it.

thanks
#
The "right answer" is .Last.value but I find that far too much to type
so I have the following in my .Rprofile

makeActiveBinding("ans", function().Last.value, .GlobalEnv)

which sets the variable "ans" to be the last value.

Michael
On Thu, Feb 9, 2012 at 9:44 PM, Sam Steingold <sds at gnu.org> wrote: