Skip to content

Commit c083c24

Browse files
committed
Favour the usage of printf over print + format
1 parent 197f34f commit c083c24

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -645,6 +645,18 @@ pairwise constructs as found in e.g. `let` and `cond`.
645645
(not (= foo bar))
646646
```
647647

648+
* <a name="printf"></a>
649+
Use `printf` instead of `(print (format ...))`.
650+
<sup>[[link](#printf)]</sup>
651+
652+
```Clojure
653+
;; good
654+
(printf "Hello, %s!\n" name)
655+
656+
;; ok
657+
(println (format "Hello, %s!" name))
658+
```
659+
648660
* <a name="multiple-arity-of-gt-and-ls-fns"></a>
649661
When doing comparisons, keep in mind that Clojure's functions `<`,
650662
`>`, etc. accept a variable number of arguments.

0 commit comments

Comments
 (0)