Falling in love with Clojure, all over again

You know when after a few months of dating someone, they do something that touches you and fall in love all over again. It just happened to me and Clojure. I was playing with Korma and I had the following namespace declaration:

(ns carouselapps.db.core
    [korma.core :refer :all]
    [korma.db :as db]
    [environ.core :refer [env]]
    [to-jdbc-uri.core :refer [to-jdbc-uri]]))

which was generating this warning:

WARNING: update already refers to: #'clojure.core/update in namespace:
              carouselapps.db.core, being replaced by: #'korma.core/update

What now? I thought I was going to spend the next two hours figuring out a clean way to deal with this, but nope, it took 5 minutes to figure out I could just rename korma.core/update  as I was requiring it:

(ns carouselapps.db.core
    [korma.core :refer :all :rename {update sql-update}]
    [korma.db :as db]
    [environ.core :refer [env]]
    [to-jdbc-uri.core :refer [to-jdbc-uri]]))

This is the kind of real world pragmatism that you rarely see in programming languages, specially those rooted in academic practices, like being a Lisp, which Clojure is.

I fell in love all over again. Sometimes it’s the small things you know!


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.