groovy beginner- how to remove a variable from memory in groovy shell
Asked Answered
A

1

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.

Alate answered 29/5, 2012 at 10:53 Comment(0)
F
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

Forefather answered 29/5, 2012 at 11:4 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.