File tree Expand file tree Collapse file tree 1 file changed +25
-0
lines changed Expand file tree Collapse file tree 1 file changed +25
-0
lines changed Original file line number Diff line number Diff line change @@ -165,6 +165,31 @@ when there are no arguments on the same line as the function name.
165165 [x] (bar x))
166166 ```
167167
168+ * <a name =" multimethod-dispatch-val-placement " ></a >
169+ Place the ` dispatch-val ` of a multimethod on the same line as the
170+ function name.
171+ <sup >[[ link] ( #multimethod-dispatch-val-placement )] </sup >
172+
173+
174+ ```Clojure
175+ ;; good
176+ (defmethod foo :bar [x] (baz x))
177+
178+ (defmethod foo :bar
179+ [x]
180+ (baz x))
181+
182+ ;; bad
183+ (defmethod foo
184+ :bar
185+ [x]
186+ (baz x))
187+
188+ (defmethod foo
189+ :bar [x]
190+ (baz x))
191+ ```
192+
168193* <a name =" docstring-after-fn-name " ></a >
169194 When adding a docstring – especially to a function using the above form – take
170195 care to correctly place the docstring after the function name, not after the
You can’t perform that action at this time.
0 commit comments