What is the difference between proxy and reify? I have some example code:
(.listFiles (java.io.File. ".")
(proxy
[java.io.FileFilter] []
(accept [f]
(.isDirectory f))))
(.listFiles (java.io.File. ".")
(reify
java.io.FileFilter
(accept [this f]
(.isDirectory f))))
the result is same, when use proxy or reify, what is better?
Update:
I found something:
- proxy no need the
thisas first parameter. - proxy support superclass.
- proxy support arguments.
From Clojure.org’s overview of data types:
Source: http://clojure.org/datatypes