Skip to main content

Ternary Expressions

Ternary expressions behave identical as to how they would in C. They introduce no new keywords.

Example Code
-- Oldlocal maxif a > b then  max = aelse  max = bend-- Newlocal max = a > b ? a : b

They also support an alternative syntax, for compatibility with older versions of Pluto:

Example Code
-- Oldlocal maxif a > b then  max = aelse  max = bend-- Newlocal max = if a > b then a else b

Interactive Example