Since I'm not sure what your purpose is, I'll also mention yasnippet for emacs, which is a general-purpose template system for generating pieces of text, but there are sets of clojure templates like https://github.com/swannodette/clojure-snippets
Basically you create a file in the right place that looks like this: #name: ns # -- (ns `(clojure-expected-ns)` "$0" (:require []) (:import ())) (set! *warn-on-reflection* true) And then when you type "n s TAB" you get something like this, with the point inside the empty docstring: (ns com.lemondronor.orbital-detector.airportdata "" (:require []) (:import ())) (set! *warn-on-reflection* true) John On Wed, Apr 8, 2015 at 10:54 AM, Michael Blume <[email protected]> wrote: > What James said -- if you want the results to be human readable, if you > want control of how it's formatted, if you want to be able to comment it, > if you want people to use it as a starting point for code they're going to > write, then check out the punctions in > https://github.com/technomancy/leiningen/blob/master/src/leiningen/new/templates.clj > -- if not, pr-str will do you fine. > > On Wed, Apr 8, 2015 at 10:25 AM James Reeves <[email protected]> > wrote: > >> On 8 April 2015 at 14:20, Sven Richter <[email protected]> wrote: >>> >>> I want to create clojure source files with some code and a namespace and >>> everything else what is useful for some source code. >>> What I am looking for is a templating language for clojure code, is >>> there something like this already? What would be the most idiomatic way to >>> do that besides just writing strings into a file? >>> >> >> What's the purpose? If it's just to generate some Clojure code that will >> never be read by a human, then you can use Clojure's backtick syntax with >> the pr-str function. If it's to generate human-readable code, then you're >> probably best using a text templating language. >> >> You may also want to look at Leiningen templates or lein-generate. >> >> - James >> >> -- >> You received this message because you are subscribed to the Google >> Groups "Clojure" group. >> To post to this group, send email to [email protected] >> Note that posts from new members are moderated - please be patient with >> your first post. >> To unsubscribe from this group, send email to >> [email protected] >> For more options, visit this group at >> http://groups.google.com/group/clojure?hl=en >> --- >> You received this message because you are subscribed to the Google Groups >> "Clojure" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to [email protected]. >> For more options, visit https://groups.google.com/d/optout. >> > -- > You received this message because you are subscribed to the Google > Groups "Clojure" group. > To post to this group, send email to [email protected] > Note that posts from new members are moderated - please be patient with > your first post. > To unsubscribe from this group, send email to > [email protected] > For more options, visit this group at > http://groups.google.com/group/clojure?hl=en > --- > You received this message because you are subscribed to the Google Groups > "Clojure" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to [email protected] Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups "Clojure" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
