Tassilo Horn <t...@gnu.org> writes: >>> But since you have to add the docstring by hand anyway, I don't think >>> that's much of an issue: >>> >>> (def ^{:doc "Applies my-function to 10 and y." >>> :arglists '([y])} >>> my-partial-function (partial my-function 10)) >> >> Sure this is what I have been doing. But when the arglist is more >> complex it is a pain and results in a lot of duplication. > > The problem is that you can't get the arglists of `my-function` here, > because :arglists is metadata of the var #'my-function, not of the > function being its value. If :arglists was metadata of functions, then > `partial`, `comp` and friends could return functions with correctly > generated :arglists (given that those are correct).
Yes, I know. Hence my thought that I have to do this with macros. It's a shame that the function option including lambda's don't have this metadata as well. > BTW: At least with complex macros, the real arglists are often very > different than what's in :arglists for documentation purposes. For > example, look at what `(doc fn)` shows, yet its only real arglist is > just `[& sigs]`. Indeed. I am using this myself, and putting arglists in like '([individual & classes][ontolology individual & classes]) which only works because I can distinguish between all the entities by type (they are java objects), so disambiguiate. Well, I guess I will code up a simple macro; in my current case, I can infer the arglists anyway. Thanks for the help! Phil -- -- 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 --- 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 clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.