Rich,

is there a reason why metadata is explicitly disabled on function  
objects?

I find myself wanting to put metadata on functions frequently. It  
seems even more important for functions than for anything else, given  
that there is no way to inspect a function object at all, it's a  
complete black box. So I looked at the implementation to see if it  
would be easy to add metadata handling, and found to my surprise that  
function objects already have a metadata pointer but that setting it  
is disabled.

Two situations where I think metadata on functions would be very useful:

- To put on a type tag. If functions are to be first-class data  
objects, it should be possible to have multimethods dispatching on a  
function argument. My concrete use case is stream-generating  
functions with different interfaces that I would like to use with a  
common interface defined as a multimethod.

- For implementing automatic derivatives, it would be useful to  
attach a derivative function to a mathematical function such as log  
or sqrt.

Konrad.

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