Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
michalmarczyk committed Apr 16, 2012
0 parents commit 8752392
Show file tree
Hide file tree
Showing 4 changed files with 70 additions and 0 deletions.
12 changes: 12 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/target
/lib
/classes
/checkouts
pom.xml
*.jar
*.class
.lein-deps-sum
.lein-failures
.lein-plugins
.lein-cljsbuild-compiler-*
/phm.js
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# cljs-persistent-hash-map-test

A bunch of helper functions with which to build jsPerf tests for the
ClojureScript port of Clojure's PersistentHashMap.

## Usage

See the JIRA ticket:

http://dev.clojure.org/jira/browse/CLJS-178

## License

Copyright © 2012 Michał Marczyk

Distributed under the Eclipse Public License, the same as Clojure.
14 changes: 14 additions & 0 deletions project.clj
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
(defproject cljs-persistent-hash-map-test "0.0.1-SNAPSHOT"
:description "Perf tests for ClojureScript port of Clojure's PersistentHashMap"
:license {:name "Eclipse Public License"
:url "http://www.eclipse.org/legal/epl-v10.html"}
:source-path "src/clj/"
:dependencies [[org.clojure/clojure "1.3.0"]
;; locally built from
;; https://github.com/michalmarczyk/clojurescript/tree/phm2
[org.clojure/clojurescript "0.0-1078"]]
:plugins [[lein-cljsbuild "0.1.7"]]
:cljsbuild {:builds [{:source-path "src/cljs/"
:compiler {:output-to "phm.js"
:optimizations :advanced
:pretty-print false}}]})
28 changes: 28 additions & 0 deletions src/cljs/phm.cljs
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
(ns phm)

(defn ^:export empty-obj-map []
cljs.core.ObjMap/EMPTY)

(defn ^:export empty-hash-map []
cljs.core.HashMap/EMPTY)

(defn ^:export empty-persistent-hash-map []
cljs.core.PersistentHashMap/EMPTY)

(defn ^:export assocwrapper [m k v]
(assoc m k v))

(defn ^:export dissocwrapper [m k]
(dissoc m k))

(defn ^:export getwrapper [m k]
(get m k))

(defn ^:export getwrapperdefault [m k not-found]
(get m k not-found))

(defn ^:export invokewrapper [m k]
(m k))

(defn ^:export invokewrapperdefault [m k not-found]
(m k not-found))

0 comments on commit 8752392

Please sign in to comment.