Permalink
Browse files

Merge branch 'r/0.7.7'

  • Loading branch information...
2 parents faa75f9 + 7fe93ad commit 2d14c20cb985f4ff9834fba5b6cdf44eaed491ef @amalloy amalloy committed Feb 6, 2012
Showing with 10 additions and 9 deletions.
  1. +6 −3 project.clj
  2. +4 −6 src/useful/datatypes.clj
View
@@ -1,4 +1,7 @@
-(defproject useful "0.7.6"
+(defproject useful "0.7.7"
:description "A collection of generally-useful Clojure utility functions"
- :dependencies [[clojure "1.3.0"]
- [org.clojure/tools.macro "0.1.1"]])
+ :dependencies [[clojure "1.4.0-beta1"]
+ [org.clojure/tools.macro "0.1.1"]]
+ :multi-deps {"1.3" [[clojure "1.3.0"]]
+ "1.2" [[clojure "1.2.1"]]
+ :all [[org.clojure/tools.macro "0.1.1"]]})
View
@@ -7,8 +7,6 @@
(defn- normalize-field-name [field]
(-> (name field)
- (s/replace #"_QMARK_" "?")
- (s/replace #"_" "-")
symbol))
(defn- ^Class coerce-class
@@ -37,7 +35,7 @@
(if-let [i (index (normalize-field-name field))]
(assoc vals i val)
(assoc-in vals
- [(index '--extmap) (keyword field)] val)))
+ [(index '__extmap) (keyword field)] val)))
(vec (repeat (count fields) nil))
(into-map attrs))]
`(new ~type ~@vals)))
@@ -78,10 +76,10 @@
vals (reduce (fn [vals [f field & args]]
(if-let [i (index (normalize-field-name field))]
(assoc vals
- i (apply list f (get vals i) args))
- (let [i (index '--extmap)]
+ i `(~f ~(get vals i) ~@args))
+ (let [i (index '__extmap)]
(assoc vals
- i (apply list `update (get vals i) (keyword field) args)))))
+ i `(update ~(get vals i) ~(keyword field) ~@args)))))
(vec (map #(list '. r %) fields))
forms)]
`(let [~r ~record]

0 comments on commit 2d14c20

Please sign in to comment.