Yesterday, I started the clojure koans, and all the koans related with the data structures were to easy and showed how easy and cool data structures are at clojure, but I got my first stopper :) when I was faced with a higher order function that I’d completely forgot.
What are higher order functions?
They are functions that have at least one of the following properties
- Return functions (for example functions that are mapped to other functions like Integration - Calculus)
- Take at least one function as a paramater (function composition g(f(x)))
From my examples looks like I hadn’t forgot what is a mathematical higher function, and the functions composition case remember me, the C/C++ feature to receive functions pointers as parameters ;) quick example at http://www.cplusplus.com/reference/clibrary/cstdlib/qsort/
My solution for the first higher order function koan https://github.com/sarcilav/clojure-koans/commit/cd2f89e5620a4a195c03d7e71e8bc8827b045345
You could check my solutions at https://github.com/sarcilav/clojure-koans/tree/solutions