Groovy web console

subscribe to the feed Subscribe
to this
site

kwargs

Published 1 month ago by alex
Actions  ➤ Edit in console Back to console Show/hide line numbers View recent scripts
def foo(Map kwargs, String parent = null, String name, Closure body) {
    body(parent, name, kwargs)
}

foo("parent", "name", foo: "bar", baz: 42) { def p, n, kwargs ->
    println(p)
    println(n)
    println(kwargs)
}

println()

foo(baz: 42, "parent", foo: "bar", "me") { p, n, kwargs ->
    println(p)
    println(n)
    println(kwargs)
}