generate human-readable code from vectors
Demo http://repo.cirru.org/writer.clj/
[cirru/writer "0.1.11"]
(cirru-writer.core/write-code [["define"
"a"
["read" "cd"]
["if" [">" "a" "cd"] ["print" "demo"] ["print" "not demo"]]]
["say" ["print" "a" ["save" ["b" ["x" ["c" "8"]]]]]]
["print" "fun"]]
)
prints:
define a (read cd)
if (> a cd)
print demo
print "not demo"
say $ print a
save $ b (x $ c 8)
print fun
Added a inline mode:
(write-code [["a" ["b" "c"] ["d" "e"] ["g" "h"]]] {:inline? true})
which generates simple expressions as inline node:
a (c b) (d e) (g h)
Test:
yarn
yarn watch-test
# another terminal
node target/test.js
https://github.com/mvc-works/coworkflow/
MIT
Can you improve this documentation?Edit on GitHub
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close