Anonymous user
Runtime evaluation: Difference between revisions
→Eval shortcut
Line 117:
====Eval shortcut====
For simple evaluation of string-based scripts with only a few variables (like this one), the '''Eval''' class has static shortcut methods that do the '''Binding''' setup and '''GroovyShell''' evaluation under the surface. '''Eval.me(script)''' evaluates a script with no variables. '''Eval.x(x,script)''', '''Eval.xy(x,y,script)''',
<lang groovy>def years5 = Eval.xy(2008, 2121, '''
(x..y).findAll {
|