14 May '13, 1pm

Clojure: Testing The Creation Of A Partial Function

I recently refactored some code that takes longs from two different sources to compute one value. The code originally stored the longs and called a function when all of the data arrived. The refactored version partials the data while it's incomplete and executes the partial'd function when all of the data is available. Below is a contrived example of what I'm taking about. Let's pretend we need a function that will allow us to check whether or not another drink would make us legally drunk in New York City. The code below stores the current bac and uses the value when legally-drunk? is called. The following (passing) tests demonstrate that everything works as expected. This code works without issue, but can also be refactored to store a partial'd function instead of the bac value. Why you would want to do such a thing is outside of the scope of this post, so we'll just assu...

Full article: http://blog.jayfields.com/2013/05/clojure-testing-creatio...

Tweets

Emacs Lisp: Font Lock for Clojure's Partial

blog.jayfields.com 15 May '13, 1pm

I love using partial, but I dislike the length of the function name. There's a simple solution, define another function wi...

We're all psyched up for Audi Star Creation Capsule Collection Showcase that is happening this Friday, 17 May at...

We're all psyched up for Audi Star Creation Cap...

juice.com.sg 15 May '13, 9am

Last year, Roderic Wong blew the judges at the Audi Star Creation 2012 away with the craftsmanship for his collection, Tis...

German Court Says Google Must Block Libelous Wo...

searchengineland.com 14 May '13, 5pm

Because Google’s autocomplete function uses an algorithm that relies on the frequency of previously searched terms, Bloomb...

Paul McCartney Wants Global Ban on Cosmetic Testing on Animals via @ecorazzi

Paul McCartney Wants Global Ban on Cosmetic Tes...

ecorazzi.com 15 May '13, 10am

(BUAV) to advocate for a much broader ban. The Beatle said, “I have supported Cruelty Free International’s founding organi...