I have a language request for the fn special form.

Functions can now have metadata. This is great, and very useful for
me.

I'd like to request that now the (fn name …) form pass on any metadata
on the name symbol to the function itself:

user=> (meta (fn ^{:a 3} name …))
{:a 3}

This would ideally come especially in handy in letfn:

user=> (letfn [(^{:a 3} some-fn …)] (meta some-fn))
{:a 3}

The above is currently impossible at all; def must be used instead.
The proposal above would make it possible, and it would be a logical
extension of enabling metadata on functions.

This matters especially for me, because I use function metadata in my
parser library's rules to validate rules, store rule labels, and other
things. I would love for this to happen, and I'd like to know the
prospects of this feature being implemented for Clojure 1.3.

-- 
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

Reply via email to