Created
November 4, 2011 23:54
-
-
Save mike-neck/1340828 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 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