"How do I actually just load code w/o evaluating it?" mostly when you want something like this, you want a macro. Manipulating code is also done within macros.
http://www.gigamonkeys.com/book/macros-standard-control-constructs.html http://www.gigamonkeys.com/book/macros-defining-your-own.html Jonathan On Tue, May 10, 2011 at 5:36 AM, Bill Robertson <billrobertso...@gmail.com>wrote: > How do I actually manipulate it? I have some complicated logic that I > would like to transform into html (or maybe xml) for display > purposes. > > I'm generating the Clojure code by parsing some nasty Java and > outputting s-expressions. The Java is basic, but quite deeply > nested. I want to generate working Clojure to demonstrate what that > can do for us, and get this nastiness documented of course. > > Other than going into the source files and transforming it by hand > into a series of defs and quoted lists e.g. (def my_func '(+ 1 2)) > How do I actually just load code w/o evaluating it? > > I've found the pretty printer macros, seems like that might be useful > if I wanted to statically transform the code. I found the walker, > that looks like it might be useful in actually generating the output > (e.g. visit things, spit out (x|ht)ml. > > I looked at the various load functions in clojure.core. With the > exception of load (http://clojure.github.com/clojure/clojure.core- > api.html#clojure.core/load) they all seem to load and evaluate. Is > load the answer or is it something I haven't found yet? > > Once I get the code loaded, I don't think I need anything out of the > ordinary like macros or multi-methods. I think I can just manipulate > the lists. Does that sound correct? > > I'm sorry if this are a stupid questions, but I've never done anything > in Clojure of any significance, and any helpful answers you provide > would could save me days of stumbling about. > > Thanks! > > > -- > You received this message because you are subscribed to the Google > Groups "Clojure" group. > To post to this group, send email to clojure@googlegroups.com > Note that posts from new members are moderated - please be patient with > your first post. > To unsubscribe from this group, send email to > clojure+unsubscr...@googlegroups.com > 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 post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en