Mercurial > rlm
diff src/rlm/decorators.clj @ 0:78a630e650d2
initial import
author | Robert McIntyre <rlm@mit.edu> |
---|---|
date | Tue, 18 Oct 2011 00:57:08 -0700 |
parents | |
children |
line wrap: on
line diff
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/src/rlm/decorators.clj Tue Oct 18 00:57:08 2011 -0700 1.3 @@ -0,0 +1,11 @@ 1.4 +(ns rlm.decorators) 1.5 + 1.6 + 1.7 +(defn preserve-meta 1.8 + "returns a function that will return objects with 1.9 + same metadata as the last argument to that function" 1.10 + [f] 1.11 + (fn [& x] (with-meta 1.12 + (apply f x) 1.13 + (meta (last x))))) 1.14 +