clojure-contrib

How does ClojureQL compare to clojure.contrib.sql?

为君一笑 提交于 2019-12-02 19:00:32
It looks like each one covers the basic cases like selecting certain columns and filtering by predicate pretty well, but I'm wondering how each compares for more advanced cases. Is it easier to express complex queries in one vis-à-vis the other? Is one library missing any functionality that the other covers? ClojureQL and clojure.contrib.sql are two quite different libraries. The first aims to implement the primitives from relational algebra and compile those to SQL92. It also offer an extensible compiler that can be adapted to database specific SQL dialect. The second is a lightweight set of

Insertions into Zipper trees on XML files in Clojure

偶尔善良 提交于 2019-11-30 19:34:39
I'm confused as how to idiomatically change a xml tree accessed through clojure.contrib's zip-filter.xml. Should be trying to do this at all, or is there a better way? Say that I have some dummy xml file "itemdb.xml" like this: <itemlist> <item id="1"> <name>John</name> <desc>Works near here.</desc> </item> <item id="2"> <name>Sally</name> <desc>Owner of pet store.</desc> </item> </itemlist> And I have some code: (require '[clojure.zip :as zip] '[clojure.contrib.duck-streams :as ds] '[clojure.contrib.lazy-xml :as lxml] '[clojure.contrib.zip-filter.xml :as zf]) (def db (ref (zip/xml-zip (lxml

Insertions into Zipper trees on XML files in Clojure

筅森魡賤 提交于 2019-11-30 03:10:52
问题 I'm confused as how to idiomatically change a xml tree accessed through clojure.contrib's zip-filter.xml. Should be trying to do this at all, or is there a better way? Say that I have some dummy xml file "itemdb.xml" like this: <itemlist> <item id="1"> <name>John</name> <desc>Works near here.</desc> </item> <item id="2"> <name>Sally</name> <desc>Owner of pet store.</desc> </item> </itemlist> And I have some code: (require '[clojure.zip :as zip] '[clojure.contrib.duck-streams :as ds] '[clojure

Clojure XML Parsing

…衆ロ難τιáo~ 提交于 2019-11-29 18:48:18
I can not find any info on how to parse xml documents and access elements. I have found two ways to parse the xml document (clojure.zip/xml-zip (clojure.xml/parse file)) and (parse-seq file) but i can seem to find any info on how to process the resulting structure? Source file's refers to zip-query.clj on how to query the result but that seems to missing too. Pinochle Suppose you have the following xml to parse in your file: <high-node> <low-node>my text</low-node> </high-node> you load clojure.xml : user=> (use 'clojure.xml) when parsed, the xml will have the following structure: {:tag :high

Clojure XML Parsing

烈酒焚心 提交于 2019-11-28 13:45:52
问题 I can not find any info on how to parse xml documents and access elements. I have found two ways to parse the xml document (clojure.zip/xml-zip (clojure.xml/parse file)) and (parse-seq file) but i can seem to find any info on how to process the resulting structure? Source file's refers to zip-query.clj on how to query the result but that seems to missing too. 回答1: Suppose you have the following xml to parse in your file: <high-node> <low-node>my text</low-node> </high-node> you load clojure