所以...简要来说,这是我的core.clj文件
(ns ffmpeg-in-a-jar.core
(:gen-class)
(:require [ffmpeg-in-a-jar.encoder :as encoder]))
(defn -main
"ffmpeg autoencoder made with Clojure"
[& args]
(println "Files will begin encoding..." ))
在encoder.clj文件中,我定义了一个用户自定义的循环计数器
(defn loop-cnt []
(println "How many files to encode?")
(def loopnum (read-string (read-line)))
(println "\n""Files ready to encode"))
(loop-cnt)
它就在循环中使用后,再次请求用户输入
(defn queue []
(loop [loopnum loopnum
file-queue []]
(if (not= loopnum 0)
(do
(def file-queue [])
(println "\n""Write filenames one by one")
(def add-queue (read-line))
(recur (dec loopnum) (conj file-queue add-queue)))
file-queue)))
我使用以下方式调用这些(代码已省略)
(loop-cnt)
(def queue-result (queue))
(println "\n""Added to the Encoding Queue:" "\n" queue-result "\n")
我的真正疑惑是,encoder是如何工作的,我用require使其可用,但我还没有在-iostate中调用它,我以为应该是这样
(encoder/loop-cnt)
(println "\n" "Added to the Encoding Queue:" "\n" encoder/queue-result "\n")
ns宏是否在做一些我不清楚的事情?