diff options
author | Chouser <chouser@n01se.net> | 2008-09-17 00:04:04 +0000 |
---|---|---|
committer | Chouser <chouser@n01se.net> | 2008-09-17 00:04:04 +0000 |
commit | a67ffc6bf63f54f63d033763dd18341d5e15f156 (patch) | |
tree | 21e4d174df73c23c1af383ee03d9087ff9779772 /clojurescript/t03.cljs | |
parent | c68f9aefb7d4b4f2240e196556f83f76e9fd4ef5 (diff) |
ClojureScript: Dynamic Vars now work: binding and set!
Diffstat (limited to 'clojurescript/t03.cljs')
-rw-r--r-- | clojurescript/t03.cljs | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/clojurescript/t03.cljs b/clojurescript/t03.cljs new file mode 100644 index 00000000..3937cfa7 --- /dev/null +++ b/clojurescript/t03.cljs @@ -0,0 +1,14 @@ +(ns net.n01se) + +(def x 5) +(def y 10) + +(defn bind-test [] + (when (= x 2) + (set! y 90)) + (binding [x (dec x) y (inc y)] + (when (pos? x) + (bind-test))) + (prn x y)) + +(bind-test) |