What about returning the closure from the script?
Eval.me("return { build('my job') } ")
What do you intend using that L:
? Returning a map? If is that so, you can use square brackets:
groovy:000> a = Eval.me("[L: { build('test for') }]")
===> {L=Script1$_run_closure1@958d49}
groovy:000> a.L
===> Script1$_run_closure1@958d49
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…