Language Reference

Conditionals

Branch logic using readable if and otherwise statements.

Conditional verbs

  • Use if, else if, otherwise.
  • Combine checks with and, or.
  • Use natural comparisons.

Basic branching

Use natural language comparisons to drive the branch logic.

conditionals.pln
if score is greater than 90 then do
    print "Excellent"
    set grade to "A"
else if score is greater than 80 then do
    print "Good"
    set grade to "B"
otherwise do
    print "Keep going"
    set grade to "C"

Comparisons and checks

Use readable comparisons that map cleanly to Python operators.

  • is and is equal to for equality checks.
  • is greater than or is less than for numeric comparisons.
  • is empty for empty values, lists, or strings.
  • starts with and ends with for string prefixes.

Compound logic

Use and and or to combine multiple checks in one line.

compound.pln
if status is "active" and score is greater than 50 then do
    print "Approved"

if name starts with "vip" or role is "admin" then do
    print "Priority access"