Groovy web console

subscribe to the feed Subscribe
to this
site
Opcional args & DLSs (via #groovywebconsole)
tweet this snippet Tweet
this
script

Opcional args & DLSs

Published 10 months ago by Daniel
Actions  ➤ Edit in console Back to console Show/hide line numbers View recent scripts
def doSomething = {args, doSomethingElse ->
    println ''
    println "something: ${args}"
    doSomethingElse()
}


doSomething('ugly', {println 'do more'})

doSomething([not: 'not', so: 'great', yet: 123], {println ':-('}) 

doSomething([almost: 'there']) {println '!!!!'}

doSomething(very: 'very', 'but very': 'very') {println 'crazy'}