Created
June 3, 2014 15:58
-
-
Save rxacevedo/50af95e327567b43f7ef to your computer and use it in GitHub Desktop.
Reify example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(let [is-dir (memfn isDirectory) | |
ff (reify java.io.FileFilter | |
(accept [this f] | |
(is-dir f)))] | |
(pprint | |
(seq | |
(.listFiles (java.io.File. "C:/") ff)))) | |
;; (#<File C:\$Recycle.Bin> | |
;; #<File C:\apache-ant-1.7.1> | |
;; #<File C:\Applications> | |
;; #<File C:\appserver> | |
;; #<File C:\bin> | |
;; #<File C:\CC604> | |
;; #<File C:\cygdrive> | |
;; #<File C:\cygwin> | |
;; #<File C:\dell> | |
;; #<File C:\Documents and Settings> | |
;; #<File C:\dynatrace> | |
;; #<File C:\emacs-24.3> | |
;; #<File C:\Intel> | |
;; #<File C:\java> | |
;; #<File C:\jruby-1.7.2> | |
;; #<File C:\log> | |
;; #<File C:\MSOCache> | |
;; #<File C:\ORACLE> | |
;; #<File C:\P3> | |
;; #<File C:\PerfLogs> | |
;; #<File C:\Program Files> | |
;; #<File C:\ProgramData> | |
;; #<File C:\properties> | |
;; #<File C:\Recovery> | |
;; #<File C:\ruby-dev> | |
;; #<File C:\Ruby193> | |
;; #<File C:\sbx> | |
;; #<File C:\shared> | |
;; #<File C:\System Volume Information> | |
;; #<File C:\tmp> | |
;; #<File C:\Users> | |
;; #<File C:\Windows>) | |
;; => nil |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment