On Thursday 04 December 2008 14:41, Meikel Brandmeyer wrote: > Hi, > > Am 04.12.2008 um 18:30 schrieb Mon Key: > > It looks like I was getting turned around by the implicit do (and > > by my preconceptions coming from other Lisps where the docstring > > likes to sit behind the arglist) > > This doesn't work well with Clojure, because you can have > multiple argument vectors: > > (defn foo > "docstring here" > ([x] (do-something-with-one-arg x)) > ([x y] (we-can-also-do-two x y))) > > Behind which arglist should we put the docstring. ;)
Actually, I think each arity overload of a function deserves to be independently documentable, just as each overload of a method name in a Java class would be. It would seem to be a syntactically upward-compatible change to allow a doc-string before each overload's argument vector (inside the paren). The details of what (doc ...) would present in such cases would have to be decided and, perhaps more significantly, the way the metadata was structured would have to be revamped, and that may entail non- backward-compatible changes (to any code that examines the metadata on Vars that hold functions). And am I mistaken in my reading of the API docs for (defmulti ...) and (defmethod ...) or is there no accommodation in either for doc-strings? Surely that's not the case, right? > ... > > Sincerely > Meikel Randall Schulz --~--~---------~--~----~------------~-------~--~----~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/clojure?hl=en -~----------~----~----~----~------~----~------~--~---