From b35c948e8b142c14f9f8da0f21c9dd455403f7dd Mon Sep 17 00:00:00 2001 From: Phill Wolf Date: Sat, 3 May 2025 23:05:02 -0400 Subject: [PATCH] A rich comment's closing parenthesis may be on the next line. - Note an exception to the rule "Gather trailing parentheses" as discussed in issue #259. --- README.adoc | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/README.adoc b/README.adoc index deb86a7..8a826b5 100644 --- a/README.adoc +++ b/README.adoc @@ -495,7 +495,7 @@ of commas and line breaks. === Gather Trailing Parentheses [[gather-trailing-parens]] -Place all trailing parentheses on a single line instead of distinct lines. +Place trailing parentheses on a single line instead of distinct lines. [source,clojure] ---- @@ -509,6 +509,21 @@ Place all trailing parentheses on a single line instead of distinct lines. ) ---- +An exception to the rule is a rich comment for REPL-oriented programming, +lest gathering the comment's closing parenthesis make the last form in the comment harder to use. +A rich comment's closing parenthesis may be on the next line. + +[source,clojure] +---- +;; good; rich comment ends on the next line +(comment + (range 5) + (interpose '* (range 5)) + (->> (range 5) (interpose '*)) + (= *1 *2) + ) +---- + === Empty Lines Between Top-Level Forms [[empty-lines-between-top-level-forms]] Use a single empty line between top-level forms.