Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我在 Groovy shell 中看不到任何从内存中删除变量的方法……这可能吗?我该怎么做呢?我可以在 Beanshell 和 Javascript(Rhino) 中看到执行此操作的方法,但在 Groovy 中看不到。
我相信你可以做到:
binding.variables.remove 'varname'
或者,如果要删除所有变量,则
purge variables
应该也可以