Skip to content

Instantly share code, notes, and snippets.

@mike-neck
Created November 4, 2011 23:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mike-neck/1340828 to your computer and use it in GitHub Desktop.
Save mike-neck/1340828 to your computer and use it in GitHub Desktop.
/**
* Written by @mike_neck ( https://twitter.com/#!/mike_neck )
* for Japan Groovy / Grails User Group Camp 2011.
*/
Integer.metaClass.define {
clos = {diff ->
def c = delegate + diff
return {
print (c as char)
c as int
}
}
}
def list = []
def before = 0 as int
$/Hello I'm @mike_neck working in TopGate Inc.
I'm very grad to be in Groovy Camp 2011.
I started Groovy at this June.
I'm interested in Gradle, Grails, Closure.
Now I'm in death march project right now.
So I'll be writing document in this camp.
These documents are logical documents.
So I can write them in Groovy.
I think Groovy is document but is runnable document.
/$.each {
def c = it as char
def diff = (c as int) - before
before = c as int
list << diff
}
int c = 0
list.each {
c = c.clos(it)()
if(c == 10) Thread.sleep(4000)
}
null
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment