>>>>>>> 24b6b53 ( 【init】)
使用样例:
(ns org.currylogic.damages.http.expenses)
(use 'org.danlarkin.json)
(use 'clojure.xml)
(defn import-transactions-xml-from-bank [url]
(let [xml-document (parse url)]
;; more code here
(defn totals-by-day [start-date end-date]
(let [expenses-by-day (load-totals start-date end-date)]
(encode-to-str expenses-by-day)))
use takes all public functions from the namespace and includes them in the current namespace.
encode-to-str 和 parse 是来自于引入的外部函数,使用 use 可以获取到这些函数,但是会摸不到头脑:这些函数是在哪里定义的?
更简洁的,使用 require.