Groovy web console

subscribe to the feed Subscribe
to this
site

Ruby Lazy evaluation in functions

Published 2 months ago by Markus
Actions Execute script  ▶ Edit in console Back to console Show/hide line numbers View recent scripts
def replaceWithPassword(toString) {
    PASSWORD = "1234"
    printTheString(toString)
}

def printTheString(toBePrinted) {
    println(toBePrinted)
}


replaceWithPassword("This is the password: ${->PASSWORD}")