fork download
  1. def hash(text) { "hash for $text" }
  2.  
  3. def doSomething(text) { "something with $text" }
  4.  
  5. def generateUniqueIdent(String text, uniqueSuffix = { hash(text) }) {
  6. doSomething(text) + uniqueSuffix()
  7. }
  8.  
  9. println generateUniqueIdent("hello")
Success #stdin #stdout 1.01s 217280KB
stdin
Standard input is empty
stdout
something with hellohash for hello