On Wed, Jul 8, 2009 at 9:11 AM, Mike <[email protected]> wrote: > One of the things that drew me to Clojure was the fact that it's > homoiconic (and my previous lisp [Scheme] was not necessarily), which > means code is data, macro writing is easy etc. etc. > > What I'm missing is why I can't print a function. I understand that > most of the functions I write use quite a few macros, and after > expansion into the core forms it looks shredded...but isn't there any > way for me to see a representation of this "source" after a function > has been compiled? >
If you want to see macro expansions, macroexpand and macroexpand-1 will do ya. If you want to be able to query a function for its source code later on, that's tougher. You'll need to make a macro that wraps defn and assigns a copy of the body form to a metadata tag on the function's name. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
