Mercurial > rlm
comparison 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 |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:78a630e650d2 |
---|---|
1 (ns abomination-desolation) | |
2 | |
3 ;; The Abomination: | |
4 | |
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)))))) | |
14 | |
15 ;; The Desolation: | |
16 | |
17 (defn doit [] | |
18 (dolet | |
19 i = 5 | |
20 j = 10 | |
21 (println i j) | |
22 k = (+ i j) | |
23 (* k 2))) |