Fork me on GitHub
#babashka
<
2019-12-13
>
borkdude17:12:48

Babashka v0.0.41 Support for --classpath and --main: https://github.com/borkdude/babashka/#classpath

borkdude20:12:11

coolio, this seems to work:

$ rlwrap ./bb
Babashka v0.0.42-SNAPSHOT REPL.
Use :repl/quit or :repl/exit to quit the REPL.
Clojure rocks, Bash reaches.

user=> (require '[clojure.data.xml :as xml] )
nil
user=> (xml/parse-str "<item></item>")
#xml/element{:tag :item}
user=> (def xml (xml/parse-str "<item></item>"))
#'user/xml
user=> (xml/emit-str (assoc xml :content [(xml/element :child {})]))
"<?xml version=\"1.0\" encoding=\"UTF-8\"?><item><child/></item>"

sogaiu22:12:49

i guess that's on the clojure.data.xml branch:

$ ./bb
Babashka v0.0.42-SNAPSHOT REPL.
Use :repl/quit or :repl/exit to quit the REPL.
Clojure rocks, Bash reaches.

user=> (require '[clojure.data.xml :as cdx])
nil
user=> (cdx/parse-str "<item>smile</item>")
#xml/element{:tag :item, :content ["smile"]}
user=> (def xml (cdx/parse-str "<item>smile</item>"))
#'user/xml
user=> (cdx/emit-str (assoc xml :content [(cdx/element :kid {})]))
"<?xml version=\"1.0\" encoding=\"UTF-8\"?><item><kid/></item>"
user=> (cdx/emit-str xml)
"<?xml version=\"1.0\" encoding=\"UTF-8\"?><item>smile</item>"

borkdude22:12:43

that's right