This is not a real-world example.
As you correctly understood, each clause has a condition and a result. The conditions are: empty?, square and else. The answers are 3, 7 and 9.
cond
will look for the first condition that evaluates to #t
. In Scheme, everything is #t
except #f
. So the first condition evaluates to true:
> (if empty? "true" "false")
"true"
and cond
returns the first result, 3.