Skip to content

Commit c669430

Browse files
authored
when vs if clarification
The original "Use when instead of (if …​ (do …​))" made me skip it because I did not have a `do` in my code, only `(if cond something...)`. So I want to clarify that it applies to all single-branch ifs, no matter whether they use do or not.
1 parent d096eaa commit c669430

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

README.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1313,7 +1313,7 @@ You'll rarely need an actual boolean value in Clojure, but it's useful to know h
13131313

13141314
=== `when` vs `if` [[when-instead-of-single-branch-if]]
13151315

1316-
Use `when` instead of `(if ... (do ...))`.
1316+
Use `when` instead of `if` with just the truthy branch, as in `(if ... (do ...))`.
13171317

13181318
[source,clojure]
13191319
----

0 commit comments

Comments
 (0)