Mercurial > rlm
annotate 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 |
rev | line source |
---|---|
rlm@0 | 1 (ns rlm.decorators) |
rlm@0 | 2 |
rlm@0 | 3 |
rlm@0 | 4 (defn preserve-meta |
rlm@0 | 5 "returns a function that will return objects with |
rlm@0 | 6 same metadata as the last argument to that function" |
rlm@0 | 7 [f] |
rlm@0 | 8 (fn [& x] (with-meta |
rlm@0 | 9 (apply f x) |
rlm@0 | 10 (meta (last x))))) |
rlm@0 | 11 |