On Thu, 2011-06-02 at 10:49 -0300, Ricky Clarkson wrote: > > Thus Groovy does > > not lack static typing, > > Um, yes it does. int i = "foo"; compiles quite happily under Groovy.
Yes. All type checking is done at run time, its a dynamically typed language after all! When you run the code it tells you that you cocked up. org.codehaus.groovy.runtime.typehandling.GroovyCastException: Cannot cast object 'foo' with class 'java.lang.String' to class 'int' This comes with the territory of a dynamically typed language, hence the name. > > OK so Alex Tkachman has created Groovy++ which is a compiler shim to > > apply static typing > > That's surely an acknowledgement that Groovy lacks static typing. No it isn't. By statically typing and compiling, a whole set of (possibly not interesting to you, but interesting to me) techniques are lost. Groovy++ is just a phase of programming that sits between the chaos that is Groovy and the verbose restriction that is Java. This is not a black/white issue, it's all a question of what level of grey you want. -- Russel. ============================================================================= Dr Russel Winder t: +44 20 7585 2200 voip: sip:[email protected] 41 Buckmaster Road m: +44 7770 465 077 xmpp: [email protected] London SW11 1EN, UK w: www.russel.org.uk skype: russel_winder
signature.asc
Description: This is a digitally signed message part
