Java Mailing List Archive

http://www.gg3721.com/

Home » user.groovy »

[groovy-user] Closure question

Martin McFly

2010-03-16


Author LoginPost Reply

Hi,

how do I convert the following in a closure call:

def aMethod(parameter) {
def result = aList.grep { relevantElements(it, parameter) }
// something
}

private relevantElement(element, parameter) {
// do something
}

so how can I convert the method "relevantElement" in a closure ? and how
does the caller has to look like then ?

Thanks
--
Sent from the groovy - user mailing list archive at Nabble.com.


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

  http://xircles.codehaus.org/manage_email


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