Skip to content
Andrew edited this page Sep 4, 2013 · 6 revisions

A condition is represented by the if keyword:

let a = 10
if a > 5 then
    print "a is bigger than 5"
else
    print "a is small"

In LENS, the condition statement can be used as an expression:

var stmt = if a > 5 then "bigger" else "smaller"

When used as an expression, the condition must fulfill the following requirements:

  • The else clause must be specified
  • The expressions returned by both cases must be compatible

Clone this wiki locally