muhuk's blog

The Sleeper Must Awaken

September 28, 2014

Is Clojure Homoiconic?

Homoiconicity means you can express programs in a programming language’s primitive data types. In other words; your code is data and data is code.

Clojure is, as other dialects of Lisp, a homoiconic programming language. Code is represented as lists, symbols, vectors and other Clojure data types. When the reader (parser) reads a source file, abstract syntax tree built looks exactly like the source[1].

Read more...


August 17, 2014

Lean Startup Notes - Part 2: Techniques

“If we stopped wasting people’s time, what would they do with it?”

—Eric Ries

This is the second part of my The Lean Startup notes. Enjoy!

Read more...


August 05, 2014

Clojure Macro Spotted In Wild: ? of useful

Let’s take a look at ? macro of useful this time. The docstring tells the purpose of this macro succinctly:

A useful debugging tool when you can’t figure out what’s going on: wrap a form with ?, and the form will be printed alongside its result. The result will still be passed along.

Before taking a look at the source code let’s go through some usage examples since this one’s a bit more tricky than defproject:

user=> (str (list 1 2 (+ 1 2)))
"(1 2 3)"

user=> (str (? (list 1 2 (? (+ 1 2)))))
(+ 1 2) is 3
(list 1 2 (? (+ 1 2))) is (1 2 3)
"(1 2 3)"

Read more...


August 01, 2014

Lean Startup Notes - Part 1: Theory

I have pre-ordered the The Lean Startup but then I haven’t opened its cover except to skim through a few random sentences now and then. I have finished it during my summer vacation. These are my short notes from the book. They are quite terse and mostly for my own reference. But take a look anyway, you might find these concepts interesting. In any case, I strongly recommend the book.

Read more...


July 01, 2014

Clojure Macro Spotted In Wild: defproject of Leiningen

“Programs must be written for people to read, and only incidentally for machines to execute.”

—Harold Abelson

Reading code is a great way to improve programming skill. It is not just a progressive practice though. I have observed that those who are not in the habit of reading code lose their edge eventually. Perhaps they didn’t have an edge to begin with and their lack of experience was overrated when they are evaluated. Regardless, I stand by the practice of reading code.

Read more...