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