Liking cljdoc? Tell your friends :D

Cirru Sepal for Clojure

Generate Clojure code from vectors(based on FIPP)

[ "defn" "f1" [ "x" ]
  [ "+" "x" "1" ] ]

compiles to:

(defn f1 [x] (+ x 1))

API Usage Clojars Project

[cirru/sepal "0.2.5"]
(cirru-sepal.core/write-code [["println" ["+" "2" "2"]]])

(cirru-sepal.analyze/write-file {:ns ["ns" "a.b"], :proc [], :defs {:main! ["defn" "main!" ["a" "b"]]}})

In file mode, code will be ordered in an order, with definitions sorted by dependencies. (declare some-function) would be generated if potential circular dependencies detected.

:ns
:defs
  def1
  def2
  ...
:proc

Special forms:

  • []
  • {}
  • #{}
  • ; and ;;
  • case
  • def
  • defn, defn$(with arity overloading)
  • defn-, defn$-(with arity overloading)
  • fn, fn$(with arity overloading)
  • fn*, #()
  • let
  • loop
  • ns
  • doseq

Special syntaxes:

  • |str and "str generates "str"
  • #"x generates #"x"

Find working examples in data/examples/ and data/compiled/.

Test

yarn test

Acknowledgements

License

MIT

Can you improve this documentation?Edit on GitHub

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close