there are a few related questions on SO but I just can't seem to figure this out. I've got a very simple test code:
(ns test
(:gen-class)
(:require [clojure.java.io :as io]))
(defn tail-file
[path handler-func]
(org.apache.commons.io.input.Tailer/create
(io/file path)
(proxy [org.apache.commons.io.input.TailerListenerAdapter] []
(handle [this line] (handler-func line)))))
(defn -main
[& args]
(tail-file "c:/tmp/test.txt" println)
(read-line))
This results in:
Exception in thread "Thread-0" clojure.lang.ArityException: Wrong number of args (2) passed to: core/tail-file/fn--28
That's strange because tail-file takes two arguments ([path handler-func]).