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.
这是可能的,如果,如何?
item.foo = "moo" def x = "foo" item.[x] = "moo"
我不确定我是否明白你的问题,但是...
def item = { def foo } def x = "foo" item[x] = "moo" assert item[x] == "moo" assert item.foo == "moo"