read or learn more
λ λ λ
Fogus' Thoughts on life, programming, and thinking
❤ c clj erl pl frink fth cl org pure icl qi ❤
Follow me on Twitter... or RSS...
Run this blog in mobile
2024 2023 2022 2021 2020 2019 2018 2017 2016 2015 2014 2013 2012 2011 2010 2009 2008 2007 2006 2005 2004 2003 2002
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