The title might be a little confusing so let me elaborate, I've been reading some criticism regarding Scala. It was an email sent to Tyepsafe regarding some deficiencies in Scala from Coda Hale (Yammer's Infrastructure Architect), so to quote:
we stopped seeing lambdas as free and started seeing them as syntactic sugar on top of anonymous classes and thus acquired the same distaste for them as we did anonymous classes.
So, from this, I have a couple of questions regarding how lambdas work in Scala:
- What is the difference between a free function and a function that is bound to an anonymous class (technically, aren't all functions bound to the
mainsingleton object)? - What is the impact on performance of using an anonymous class bound function instead of a free function?