When is code data, and when is it code?
The first tenet of functional programming: code is data. Store it in variables, pass it as parameters, return it from methods. This is challenging in the JVM, where all code lives inside methods on objects. Therefore, Scala passes around code in a function object. Code lives in the apply() method. When is a function object created? … Read moreWhen is code data, and when is it code?