view src/rlm/abomination_desolation.clj @ 0:78a630e650d2

initial import
author Robert McIntyre <rlm@mit.edu>
date Tue, 18 Oct 2011 00:57:08 -0700
parents
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)))