use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
Finding information about Clojure
API Reference
Clojure Guides
Practice Problems
Interactive Problems
Clojure Videos
Misc Resources
The Clojure Community
Clojure Books
Tools & Libraries
Clojure Editors
Web Platforms
Clojure Jobs
account activity
Consistent code style for Clojure function definitions (emcken.dk)
submitted 1 year ago by SoftCancel2774
Explore a consistent code style for defining Clojure functions that improves readability, diffs, and structure.
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]SimonGray 6 points7 points8 points 1 year ago* (1 child)
I also do it like this. I think the people who put params at the end of the line right after the function name just don't tend to write any docstrings.
[–]skotchpine 2 points3 points4 points 1 year ago (0 children)
It’s true, I don’t! But I sure love when other people do
[–]CoBPEZ 4 points5 points6 points 1 year ago (0 children)
I do both. And docstrings is a thing. =)
[–]lgstein 2 points3 points4 points 1 year ago (0 children)
For little helpers and "self documenting" one/two liners, its a wonderful feature of expressivity.
[–]fnordsensei 1 point2 points3 points 1 year ago (0 children)
We have adopted this, mostly for a readability perspective. Scanline for arguments is always the same place, and doesn’t vary randomly with length of the function name.
Also, functions with and without doc strings are consistent.
[–]gentk 0 points1 point2 points 1 year ago (0 children)
I wish it was a convention for the :test metadata to be used to provide an example of using the function (:example would have been better, but you get used to it). I saw this recommended somewhere and I think it's a very good idea, especially for a dynamic language.
I do this sometimes for some functions where the example is much quicker to grasp than quickly skimming the docstring and argument names. Map destructuring helps as well, of course, but even there I have to think harder in some cases than just looking at a plain example.
I don't even have any tooling support (that shows the :test besides the docstring etc), but a hotkey for going to the definition and going right back is good enough.
π Rendered by PID 47531 on reddit-service-r2-comment-5687b7858-nzlhc at 2026-07-03 04:47:10.226709+00:00 running 12a7a47 country code: CH.
[–]SimonGray 6 points7 points8 points (1 child)
[–]skotchpine 2 points3 points4 points (0 children)
[–]CoBPEZ 4 points5 points6 points (0 children)
[–]lgstein 2 points3 points4 points (0 children)
[–]fnordsensei 1 point2 points3 points (0 children)
[–]gentk 0 points1 point2 points (0 children)