所以,简要地说,这是我的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来使其可用,但我在 داخل -main 中还没有调用它,我想应该是
(encoder/loop-cnt)
(println "\n" "Added to the Encoding Queue:" "\n" encoder/queue-result "\n")
ns宏做了我不知道的事情吗?