read


read
or learn more

Comparing Lines of Code: Scala and Clojure (FUD version)

Jan 4, 2010 some comments

A completely tongue in cheek comparison between Scala and Clojure, implementing the famous closure test. Scala Version1 type Supercalifragilisticexpialidocious = java.lang.Integer implicit def Supercalifragilisticexpialidocious2Int(tehThingToConvert:Supercalifragilisticexpialidocious) = { tehThingToConvert.asInstanceOf[Int] } trait ClosureTestMixin { def makeAdder(tehAdditionValue:Supercalifragilisticexpialidocious):Function1[Int,Int] } class AdderMaker extends ClosureTestMixin { def apply(tehAdditionValue:Supercalifragilisticexpialidocious):Function1[Int,Int] = { new Function1[Int,Int] { def apply(tehOtherAdditionValue:Int):Int = { return tehAdditionValue.$plus(tehOtherAdditionValue.asInstanceOf[Supercalifragilisticexpialidocious]) } } } […]

Continue