Java Mailing List Archive

http://www.gg3721.com/

Home » user.groovy »

[groovy-user] trying to do something with GroovyShell

Roger Studner

2010-03-19

Replies: Find Java Web Hosting

Author LoginPost Reply
I've seen various groovyshell exampes, such as:

def context = new Bindable()
context.startDate = 2008
context.endDate = 2121
def years3 = new GroovyShell(context).evaluate('''
(startYear..endYear).findAll (etc etc)
''')

so, I wanted to have this.

def context = new Bindable()
context.snippet = "result.funTimes"
context.result = ['funTimes':'now']
def output = new GroovyShell(context).evaluate('''
snippet
''')

which, I was hoping, somehow, woudl return/result in "now"

since the snippet is result.funTimes, *and* there is something called result bound.

But of course, it just returns the string result.funTimes heh

Anyone ahve some neat trick to do this?

Thanks,
Roger


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

  http://xircles.codehaus.org/manage_email


©2008 gg3721.com - Jax Systems, LLC, U.S.A.