Friday, May 22, 2009

Clojure function inspired by tweets between Lisa Crispin and Brett Pettichord

It's so much better to see the results from the REPL.

user=> (defn testing [dev tester]
(if (and (= dev 'f) (<= (compare tester 'b) 0)) (testing dev tester) 'ship))
#'user/testing
user=> (testing 'a 'b)
ship
user=> (testing 'f 'c)
ship
user=> (testing 'f 'b)
java.lang.StackOverflowError (NO_SOURCE_FILE:0)

No comments:

Post a Comment