Skip to content

Instantly share code, notes, and snippets.

@diegodfsd
Created June 1, 2011 02:23
Show Gist options
  • Select an option

  • Save diegodfsd/1001686 to your computer and use it in GitHub Desktop.

Select an option

Save diegodfsd/1001686 to your computer and use it in GitHub Desktop.
lista = ["primeiro", "segundo", "terceiro", 4]
println lista.size
lista += "quinto"
println lista.size
lista -= 4
println lista.size
lista << 7
println lista.size
println lista[0..-1]
dictionary = ["a" : 1, "b" : 2]
dictionary.each{ k,v -> println k + ' ' + v }
def closureSoma = {n1, n2 -> n1 + n2}
println closureSoma(2, 3)
3.times{ println "groovy" }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment