small medium large xlarge

06 Feb 2014, 20:38
Arun Sharma (1 post)

(if true (println “yes”) (println “no”)) prints yes nil But (if true “yes” “no”) prints yes

10 Apr 2015, 14:12
Alex Miller (29 posts)

(if …) is an expression that returns the value of the matched branch.

In the first case there is a side effect (println “yes”) that prints “yes”. The overall expression then returns nil, which is printed by the repl.

In the second case, there is no side effect and the expression returns “yes” which is printed by the repl.

You must be logged in to comment