-
Notifications
You must be signed in to change notification settings - Fork 282
Closed
Description
The style guide says to “gather trailing parentheses”. Does this imply that the following is incorrect?
(“rich-comment” example from yuhan0’s comment in Standard Clojure Style discussion)
;; Incorrect?
(comment
(range 5)
;; => (0 1 2 3 4)
(interpose '* (range 5))
;; => (0 * 1 * 2 * 3 * 4)
)
And the following is correct?
;; Correct?
(comment
(range 5)
;; => (0 1 2 3 4)
(interpose '* (range 5)))
;; => (0 * 1 * 2 * 3 * 4)
An auto-formatter might make the above correction to follow the “gather” rule, but then might dedent the comment since it’s no longer inside:
;; More correct?
(comment
(range 5)
;; => (0 1 2 3 4)
(interpose '* (range 5)))
;; => (0 * 1 * 2 * 3 * 4)
Perhaps to avoid this cascade of corrections, should it be recommended to use a placeholder on the hanging closing paren?
;; Better?
(comment
(range 5)
;; => (0 1 2 3 4)
(interpose '* (range 5))
;; => (0 * 1 * 2 * 3 * 4)
,)
Calva uses an :rcf
placeholder instead.
Metadata
Metadata
Assignees
Labels
No labels