I think it would be nice if the doc-string was allowed (in addition to
current behavior) to immediately follow the params vector in the
various defsomethings.
To the best of my knowledge, such a change would be non-breaking because,
a) It should be implemented such that (defn foo [] "bar") is a
function that always returns the string "bar" - like it does today,
and
b) The "eggs" string following the params vector in (defn spam []
"eggs" "pokemon") is completely harmless in current code.
Even though this change would introduce yet-another-way-to-def-fn, I
think it is a good change because it allows be to keep my [params] on
the same line as my defn's and still have a thorough doc-string. And
in my humble opinion, I think it improves the readability of function
definitions when the defn, name and [params] are on the same line
regardless of how long the doc-string is.
--
Venlig hilsen / Kind regards,
Christian Vest Hansen.
Where would it go when you have multiple parameter lists and bodies?
(defn blah ([a] (do-something-with a)) ([a b] (do-something-with a b)))
--
Michael Wood <esio...@gmail.com>
For the record, this proposal has been considered and rejected:
http://clojure-log.n01se.net/date/2008-12-30.html#10:50
Thanks for your efforts, Christian!
--Chouser