Skip to content
Branch: master
Go to file
Code

Latest commit

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

README.md

Cirru Writer in Clojure

generate human-readable code from vectors

Demo http://repo.cirru.org/writer.clj/

API Usage

Clojars Project

[cirru/writer "0.1.7-a1"]
(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)

Develop

Test:

yarn
yarn watch-test

# another terminal
node target/test.js

Workflow

https://github.com/mvc-works/coworkflow/

License

MIT

You can’t perform that action at this time.