Groovy web console

subscribe to the feed Subscribe
to this
site

sampleclosures

Published 3 months ago by jresendiz with tags closures
Actions  ➤ Edit in console Back to console Show/hide line numbers View recent scripts
def otherClo = {Integer it, Closure clo ->
   clo.call(it)
}

def clo = { Integer it ->
  otherClo(2) {
    println "OtherClo: $it"
  }
  println "Clo: $it"
}

clo(1)