> 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. ;)
That makes perfect sense, this is the rationale that I was missing on... So, is it idiomatic Clojure to wrap docstring in a #^{}? e.g. is this considered bad form: (defn foo "naked docstring is ok, but rather bad form while still nice for the relative terseness of format" [x] (+ x 1)) whereas this isn't: (defn #^{:doc "Behind which arglist should we put the docstring? Answer: A keyword - and really one should always as a matter of habit even though it adds a degree of syntactic eyeball mud" } foo ([x] (do-something-with-one-arg x)) ([x y] (we-can-also-do-two x y))) On Dec 4, 5:41 pm, Meikel Brandmeyer <[EMAIL PROTECTED]> 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. ;) > > >> Many languages work this way. In Ruby: > > Some don't :) > > But Lisp does. (Or at least Scheme does. Can't tell for CL.) > > > So, it would have been safer to assume Ruby like behaviour :) > > It's never safe to assume. It's only safe to know. So > good that you ask here on the list. :) > > Sincerely > Meikel > > smime.p7s > 5KViewDownload --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---