Skip to content
Browse files

Merge branch 'r/0.7.4-alpha1'

  • Loading branch information...
2 parents c0952dc + afa7961 commit 4db25910d3ae2619252a4deb3bbed6b0314b36ed @amalloy amalloy committed Oct 22, 2011
Showing with 6 additions and 3 deletions.
  1. +1 −1 project.clj
  2. +5 −2 src/useful/datatypes.clj
View
2 project.clj
@@ -1,4 +1,4 @@
-(defproject useful "0.7.3"
+(defproject useful "0.7.4-alpha1"
:description "A collection of generally-useful Clojure utility functions"
:dependencies [[clojure "1.2.0"]
[org.clojure/tools.macro "0.1.1"]])
View
7 src/useful/datatypes.clj
@@ -81,7 +81,10 @@
"Defines optimized macro accessors using interop and typehints for all fields in the given records."
[& types]
`(do ~@(for [type types
+ :let [tag (symbol (.getName (coerce-class type)))]
field (record-fields type)]
`(defmacro ~field [~'record]
- (list '~(symbol (str "." field))
- (with-meta ~'record {:tag '~(symbol (.getName (coerce-class type)))}))))))
+ (with-meta
+ (list '. (with-meta ~'record {:tag '~tag})
+ '~field)
+ (meta ~'&form))))))

0 comments on commit 4db2591

Please sign in to comment.
Something went wrong with that request. Please try again.