Re: Doc strings for complex cases?

2017-11-09 Thread Matching Socks
You can also put a docstring in a ns form to give context. I don't think you need anything done to Clojure itself. Or more specifically, you need not be limited by whatever Clojure has done with docstrings. Nor will you need to modify defn. You can attach any metadata you like, to the vars i

Re: Doc strings for complex cases?

2017-11-09 Thread Tim
I think I have about two cases where multiple arity doc-strings would useful and for that I could just go without, but defmethods are more of a problem for me. I find defmethods can have greater contextual differences to the point I have been placing comments inline (;commented out lines) which

Re: Doc strings for complex cases?

2017-11-09 Thread Didier
What's the point of doc strings per arity? Wouldn't (doc fn) just concatenate them all back into one anyways? Or would you extend it to take an arity argument? I think it seems to make sense to add them like that, but usability wise, when would you be looking at the doc of a single arity by its

Re: Doc strings for complex cases?

2017-11-09 Thread John Newman
Way back when - when Rich was fielding suggestions for how to do doc strings - I made the offhand comment that every arity could have it's own doc string. He didn't like the idea back then. Doubtful he will now. I'm glad he went the route he did. I believe the discussion took place on this mail l

Re: Doc strings for complex cases?

2017-11-09 Thread Mikhail Gusarov
Hello. > Should any breaking changes occur in Clojure core, Why should they? Regards, Mikhail. -- 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 modera

Re: Doc strings for complex cases?

2017-11-09 Thread Tim
Thanks for the suggestion(s), but I don't like the idea of writing custom code to implement better doc strings. Should any breaking changes occur in Clojure core, then I too could be forced to make changes and deal with broken code everywhere. If there was more community interest and the Clojure

Re: Doc strings for complex cases?

2017-11-08 Thread lawrence . krubner
I'm curious if it would be enough to write a macro that replaces defn in your code? The macro would secretly generate a different function for every arity, and therefore it could have a different doc-string for every arity, but it wouldn't have to appear that way in your code. Is that enough, or

Re: Doc strings for complex cases?

2017-11-05 Thread Stuart Halloway
Hi Tim, You suggested a great reason yourself: "peoples approach to doc strings are as varied as people are". To the extent that is true, someone would need to propose a design considerate of that variety of needs (and tradeoffs!). Without such planning, Clojure would evolve as a semi-random-walk

Re: Doc strings for complex cases?

2017-11-05 Thread Tim
I expected a code smell response, but I simply don't agree with that. I believe peoples approach to doc strings are as varied as people are. I tend to be specific and want to add more context (do not read 'more content') in my doc string(s) than others might, but at the same time it's not like t

Re: Doc strings for complex cases?

2017-11-05 Thread Mark Nutter
That actually sounds like a kind of code smell to me. If your different arities/defmethods are doing such disparate things that you can't easily describe them in a single docstring, it's worth asking whether they need to be separate functions. On Sun, Nov 5, 2017 at 7:59 AM, Tim wrote: > I'm see