21 lines
478 B
Plaintext
21 lines
478 B
Plaintext
(if (> (+ 5 4) 7)
|
|
# then
|
|
(print "5+4 > 7")
|
|
# else
|
|
(print "something has gone terribly wrong"))
|
|
|
|
(if (not true)
|
|
{
|
|
# this is a serie of expressions inside the 'then' block of the conditional
|
|
(print "true is... not true?")
|
|
(foo bar 5)
|
|
(+ 5 4) }
|
|
{
|
|
# the 'else' block can also have multiple expressions in it
|
|
(print "something")
|
|
(print "is weird") })
|
|
|
|
# conditions can be used as expressions too
|
|
(let n (if (> 5 6) "error" "5 < 6"))
|
|
(print n)
|