By the way, with-merge-meta keeps existing metadata and merges it with a
new map, if you haven't figured that out.
On Sunday, 24 March 2013 17:25:10 UTC-4, JvJ wrote:
>
> Is there any way to "open up" a function and look at the source code that
> made it? I know there is some source code in the documentation of certain
> functions, but I'm looking for a way to view the structures that make up
> the code.
>
> As a kind of work around, I made a macro called M> (shown below), but I'm
> wondering if there's a better way. Thanks.
>
>
> (defmacro M>
> "This is a meta-compilation macro. It attaches the code itself
> as metadata of the object that code evaluates to."
> [& forms]
> (if (= (count forms) 1)
> `(with-merge-meta
> ~(first forms)
> {:code '~(first forms)})
> `(with-merge-meta
> (do ~@forms)
> {:code '(do ~@forms)})))
>
--
--
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/groups/opt_out.