Cirru Sepal Experiment in Clojure
Clojure Cirru
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
src/cirru
test
.gitignore
README.md
build.boot

README.md

Cirru Sepal for Clojure

Generate Clojure code from syntax tree

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

compiles to:

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

Read Quick Start if you want to compile real code.

Special functions:

  • []
  • {}
  • #{}
  • -- for comment
  • case
  • def
  • defn
  • defn-
  • fn
  • let
  • ns

Read test/examples/ and test/compiled/ for details.

Sepal.clj used to with generate code clojure.pprint/write:

(clojure.pprint/write quoted-code :dispatch clojure.pprint/code-dispatch)

It's based on fipp for better performance and readability.

API Usage

Clojars Project

[cirru/sepal "0.0.17"]

See boot-cirru-sepal using as a plugin.

Also function make-code is exposed to transform code from Cirru syntax tree:

(ns cirru.sepal-test
  (:require [clojure.test :refer :all]
            ; cirru is an old indentation based text syntax
            [cirru.parser.core :refer [pare]]
            [cirru.sepal :refer [make-code]]))

(defn run []
  (make-code
    (pare "cirru code" "filename")))

Acknowledgements

License

MIT