Hacker News new | past | comments | ask | show | jobs | submit login

Groovy allows you to specify types of method parameters, return values, fields and local variables. This was needed for Java integration, but has the benefit that you get runtime checks for types. So in Ruby you might do:

def foo(mystring): assert mystring type_of? String mystring.length end

In Groovy you could just do:

def foo(String mystring) { mystring.length }




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: