Skip to content

Control Flow

Andrew Johnson edited this page Nov 13, 2024 · 7 revisions

LSTS offers a standard assortment of control flow operators.

If Expression

Ternary if can be used in expression position.

print(if condition then "true" else "false");

Match Expression

Match expressions permit destructuring of data in a controlled intentional manner.

print(match xyz {
   XY { x-field: X { i } } => i;
   XYZ { z-field: Z { i } } => i;
});

Clone this wiki locally