Skip to content

Commit

Permalink
Added keys & vals. Bump to 0.2.1
Browse files Browse the repository at this point in the history
  • Loading branch information
zk committed Apr 10, 2011
1 parent 4a4924c commit 40a6938
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 4 deletions.
2 changes: 1 addition & 1 deletion project.clj
@@ -1,4 +1,4 @@
(defproject cljs "0.2"
(defproject cljs "0.2.1"
:description
"An experimental Clojure(ish) to Javascript compiler similar to
[clojurescript](https://github.com/clojure/clojure-contrib/tree/master/clojurescript/). The library also provides several tools to assist you with integrating cljs into your workflow. All this in about 1k lines. Viva Clojure!
Expand Down
11 changes: 10 additions & 1 deletion src/cljs/core.clj
Expand Up @@ -873,7 +873,16 @@
(aset m (first pair) (second pair))
m)
{}
pairs)))))))
pairs))))

'(defn keys [m]
(when m
(.keys '_ m)))

'(defn values [m]
(when m
(.values '_ m)))
)))

(defn spit-cljs-core [path]
(spit path *core-lib*))
Expand Down
3 changes: 2 additions & 1 deletion src/cljs/opts.clj
Expand Up @@ -7,7 +7,8 @@
See var `defaults` for default options. "
(:use [clojure.java.io :only (file)])
(:import [java.io File FileReader]
[clojure.lang LineNumberingPushbackReader]))
[clojure.lang LineNumberingPushbackReader])
(:refer-clojure :exclude (slurp)))

(def defaults
{:source-path "src/cljs"
Expand Down
3 changes: 3 additions & 0 deletions test/cljs/test/core.clj
Expand Up @@ -181,3 +181,6 @@
(deftest test-interleave
(is (= [1 "a" 2 "b"] (eval-js '(interleave [1 2] [:a :b]))))
(is (= [1 10 2 20 3 30] (eval-js '(interleave [1 2 3] [10 20 30 40])))))

(deftest test-keys
(is (= ["foo-bar" "baz-bap"] (eval-js '(keys {:foo-bar 1 :baz-bap 2})))))
3 changes: 2 additions & 1 deletion test/cljs/test/opts.clj
@@ -1,6 +1,7 @@
(ns cljs.test.opts
(:use [cljs.opts] :reload)
(:use [clojure.test]))
(:use [clojure.test])
(:refer-clojure :exclude (slurp)))

(deftest test-slurp-opts
(let [{:keys [source-path
Expand Down

0 comments on commit 40a6938

Please sign in to comment.