To write the data to a file, you could do something like this: (spit "filename" (pr data))
And to read it back in, you could do something like: (clojure.edn/read-string (slurp "filename")) On 15 May 2014 07:20, Steven Jones <[email protected]> wrote: > Hi > > I am developing an Overtone MIDI application and wish to save/read the > state of a map to an external file. The map keys are always integers, > specifically MIDI program numbers. The map values however have one of two > forms. They are either explicit association list of key/value > pairs or functions which return assoc list. > > I could handle the task if the map values where always explicit list. My > real problem is how do I write out a Clojure function to an external > file and later reconstruct it? Ideally the file would be pure text but > that's not an absolute requirement. Are there any standard methods for > doing such a thing? > > > Thanks > > -- > 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.
