A new scripting language Groovy has just been released from Codehaus.org. It supports several nice features like closures, autoboxing, etc, and compiles down to normal Java bytecodes allowing it to easily interoperate with existing Java code.
Here's some example code from the Groovy website:
class Foo {
doSomething() {
data = ["name": "James", "location": "London"]
for (e in data) {
println("property ${e.key} is ${e.value}")
}
}
closureExample(collection) {
collection.each { println("value ${it}") }
}
static void main(args) {
values = [1, 2, 3, "abc"]
closureExample(values)
}
}
Will have to take a deeper look into this, so far it looks quite cool! :)
Posted by crafterm at December 14, 2003 05:15 PM | TrackBack