Skip to content

Conversation

pbwolf
Copy link
Contributor

@pbwolf pbwolf commented May 4, 2025

Clojure's own source code contains some sequences of expressions
apparently intended for evaluation at the REPL. These are in
top-level (comment...) forms that are invariably closed by
a parenthesis on a new line: not gathered with the last form
in the comment.

Some examples:

It is not style, but ergonomics. In REPL-oriented programming, it helps avoid the blunder of evaluating the comment itself when trying to evaluate the last form within it. The ergonomics are within the Style Guide's mission ("to improve the readability of code") because reading Clojure is not just for the eyes, but is also tactile, in the REPL.

- Note an exception to the rule "Gather trailing parentheses"
as discussed in issue bbatsov#259.
@seancorfield
Copy link
Collaborator

I agree, and Calva specifically has a formatting exception so that rich comments keep their closing ) on a separate line.

@seancorfield seancorfield merged commit b0f8588 into bbatsov:master May 4, 2025
1 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants