Skip to content

Commit

Permalink
Add records w/ and w/o fields
Browse files Browse the repository at this point in the history
  • Loading branch information
michalmarczyk committed Apr 19, 2012
1 parent bc93fcb commit d8ac662
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/cljs/phm.cljs
@@ -1,4 +1,5 @@
(ns phm) (ns phm
(:use [phm.records :only [->RFoo ->RBar]]))


(defn ^:export empty-obj-map [] (defn ^:export empty-obj-map []
cljs.core.ObjMap/EMPTY) cljs.core.ObjMap/EMPTY)
Expand Down Expand Up @@ -35,3 +36,12 @@


(defn ^:export assocbangwrapper [tm k v] (defn ^:export assocbangwrapper [tm k v]
(assoc! tm k v)) (assoc! tm k v))

(defn ^:export make-keyword [n]
(keyword n))

(defn ^:export fresh-record-four-fields []
(->RFoo nil nil nil nil))

(defn ^:export fresh-record-no-fields []
(->RBar))
5 changes: 5 additions & 0 deletions src/cljs/phm/records.cljs
@@ -0,0 +1,5 @@
(ns phm.records)

(defrecord RFoo [a s d f])

(defrecord RBar [])

0 comments on commit d8ac662

Please sign in to comment.