6

I could not see any method to remove a variable from memory in Groovy shell... is this possible? How do I do this? I can see methods for doings this in Beanshell and Javascript(Rhino) but not in Groovy.

0xAX
  • 20,957
  • 26
  • 117
  • 206
Arvind
  • 6,404
  • 20
  • 94
  • 143

1 Answers1

10

I believe you can do:

binding.variables.remove 'varname'

Or, if you want to remove all variables, then

purge variables

should work as well

tim_yates
  • 167,322
  • 27
  • 342
  • 338