Groovy beginner - how to remove a variable from memory in the groovy shell

I see no way to remove a variable from memory in the Groovy shell ... is this possible? How should I do it? I see methods for operations in Beanshell and Javascript (Rhino), but not in Groovy.

+5
source share
1 answer

I believe you can do:

binding.variables.remove 'varname'

Or, if you want to delete all variables, then

purge variables

should work well

+6
source

All Articles