This once again does NOT compile. I've done work on macros; they don't work yet..

This commit is contained in:
Simon Brooke 2026-03-30 21:49:08 +01:00
parent e3f922a8bf
commit 2b22780ccf
86 changed files with 279 additions and 153 deletions

View file

@ -0,0 +1,19 @@
#!/home/simon/bin/bb
(require '[clojure.java.io :as io])
(import '[java.lang ProcessBuilder$Redirect])
(defn grep [input pattern]
(let [proc (-> (ProcessBuilder. ["grep" pattern])
(.redirectOutput ProcessBuilder$Redirect/INHERIT)
(.redirectError ProcessBuilder$Redirect/INHERIT)
(.start))
proc-input (.getOutputStream proc)]
(with-open [w (io/writer proc-input)]
(binding [*out* w]
(print input)
(flush)))
(.waitFor proc)
nil))
(grep "hello\nbye\n" "e")