clojure-xml/parse返回一個xml文件的映射。clojure-xml/parse是否會返回一個懶惰的序列?
(ns xml-lib.core
^{:author "Charles M. Norton",
:doc "xml-lib is an xml parsing library built on clojure-xml.
Created on June 26, 2012"}
(:require [clojure.string :as cstr])
(:require [util.core :as utl])
(:require [clojure.xml :as cjxml]))
(defn ret-xml-data
"Returns a map of the supplied xml file."
[xml-fnam]
(let [test-file-nam (utl/open xml-fnam)]
(cjxml/parse xml-fnam))
返回的地圖是否懶惰,還是應該將解析調用傳遞給一個惰性序列函數?
謝謝。
(ret-xml-data "test.xml")
return(result truncated)。
{:tag :TamperExport, :attrs {:xmlns "http://
如果你想懶洋洋地使用Clojure解析XML,我建議[clojure.data.xml(https://開頭的github .com/clojure/data.xml),這是以前clojure-xml中clojure-contrib的繼承者。 –