-
-
Save rothfield/7667730 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns doremi_script_clojure.core | |
[doremi_script_clojure.to_lilypond :refer [to-lilypond]] | |
[clojure.java.io :refer [input-stream resource]] | |
[clojure.data.json :as json] | |
[clojure.pprint :refer [pprint]] | |
)) | |
(defn -json_text_to_lilypond[txt] | |
"Takes parsed doremi-script json data as text" | |
"Returns lilypond text" | |
(to-lilypond (json/read-str txt))) | |
;; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns doremi_script_clojure.to_lilypond | |
(:require | |
[clojure.pprint :refer [pprint]] | |
[clabango.parser :refer [render]] | |
[clojure.java.io :refer [resource]] | |
[clojure.string :refer [split lower-case]] | |
)) | |
(defn to-lilypond[x] | |
"Takes parsed doremi-script and returns lilypond text" | |
(render (-> "lilypond_templates/lilypond.txt" resource slurp) x)) |
I do Haskell and Clojure, mostly Clojure atm. I would agree, it should be taking the template as an argument. Use more descriptive arguments too.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
In Haskell I would change the signature of to-lilypond to take the template as an argument. Does the same apply to Clojure?