Re: Language request: Passing metadata to a fn from its name (in a fn form)

2010-05-24 Thread Sean Devlin
It doesn't sound like your metadata is metadata any more.

Should you be proxying AFn instead?

On May 24, 3:24 pm, joshua-choi rbysam...@gmail.com wrote:
 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 
 athttp://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


Re: Language request: Passing metadata to a fn from its name (in a fn form)

2010-05-24 Thread joshua-choi
I suppose I could, but that would make some things such as using letfn
for my rules impossible when the rules are mutually recursive.

In any case, it doesn't change the fact that, though functions now
have metadata, there is no way to give functions defined letfn that
metadata. This would be useful in any other case involving function
metadata, such as in logging, or tracking callings. So far, I cannot
think of any good reason to reject this proposal.

On May 24, 12:36 pm, Sean Devlin francoisdev...@gmail.com wrote:
 It doesn't sound like your metadata is metadata any more.

 Should you be proxying AFn instead?

 On May 24, 3:24 pm, joshua-choi rbysam...@gmail.com wrote:





  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 
  athttp://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 
 athttp://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