News for hackers. Stuff that matters.
Re:Do We Create Type Systems In Dynamic Languages? by martincmartin on Monday April 06, 2009 @03:08PM (#549387)
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 }

There are no comments on this comment yet.