view src/rlm/abomination_desolation.clj @ 3:c8e35134bf8e

working on qotd.
author Robert McIntyre <rlm@mit.edu>
date Wed, 18 Jan 2012 05:18:57 -0700
parents 78a630e650d2
children
line wrap: on
line source
1 (ns abomination-desolation)
3 ;; The Abomination:
5 (defmacro dolet [& [_ eq :as s]]
6 (if (and eq (= "=" (name eq)))
7 (let [[lcl _ expr & more] s]
8 `(let [~lcl ~expr]
9 (dolet ~@more)))
10 (let [[expr & more] s]
11 (if (empty? more)
12 expr
13 `(do ~expr (dolet ~@more))))))
15 ;; The Desolation:
17 (defn doit []
18 (dolet
19 i = 5
20 j = 10
21 (println i j)
22 k = (+ i j)
23 (* k 2)))