read


read
or learn more

Fun.js – Functional JavaScript

May 29, 2013 some comments

I’ve written a book entitled Functional JavaScript due out in print sometime in June 2013. In the book I introduce and explore various techniques for writing code in a functional style using the Underscore library. As much as I would have loved to delve into the ecosystem of functional JS libraries, I didn’t want to […]

Pointless programming in JavaScript

Apr 10, 2013 one comment

Using Underscore and Lemonad, how could you write a run-length encoder/decoder without ever referencing a function parameter? One way: var S = [‘a’, ‘a’, ‘a’, ‘a’, ‘b’, ‘c’, ‘c’, ‘a’, ‘a’, ‘d’, ‘e’, ‘e’, ‘e’, ‘e’]; var pack = L.partial1(L.partitionBy, _.identity); pack(S); //=> [[‘a’, ‘a’, ‘a’, ‘a’], [‘b’] …] var rle = _.compose( L.partial1(L.flip(_.map), L.juxt(L.plucker(‘length’), […]

fun.js

Mar 20, 2013 some comments

A few years ago I got the idea that it would be fun to implement a variant of Scheme targeting the JVM. During my search for different ways to implement numerics I looked deeply at the implementation of two languages: JScheme and a little-known language Clojure. During my explorations with these two languages and the […]

Continue <<