Re: the inverse function of load or load-file

2009-06-24 Thread ogcraft
Thanks a lot, Adrian. Adrian Cuthbertson wrote: > You can use the following; > > (defn frm-save > "Save a clojure form to file." > [#^java.io.File file form] > (with-open [w (java.io.FileWriter. file)] > (binding [*out* w *print-dup* true] (prn frm > > (defn frm-load > "Load a cloj

Re: the inverse function of load or load-file

2009-06-23 Thread Adrian Cuthbertson
Sorry, (prn frm) should have been (prn form). On Wed, Jun 24, 2009 at 5:33 AM, Adrian Cuthbertson < adrian.cuthbert...@gmail.com> wrote: > You can use the following; > > (defn frm-save > "Save a clojure form to file." > [#^java.io.File file form] > (with-open [w (java.io.FileWriter. file)] >

Re: the inverse function of load or load-file

2009-06-23 Thread Adrian Cuthbertson
You can use the following; (defn frm-save "Save a clojure form to file." [#^java.io.File file form] (with-open [w (java.io.FileWriter. file)] (binding [*out* w *print-dup* true] (prn frm (defn frm-load "Load a clojure form from file." [#^java.io.File file] (with-open [r (java.i

the inverse function of load or load-file

2009-06-23 Thread ogcraft
Dear all, Is there an inverse function of load or load-file. I mean the "save" function which writes the clojure variables or entire workspace context (in textual form) to the file? That we can load-file on such file and get the same variables as when "save" was originally invoked. --~--~