-
-
Notifications
You must be signed in to change notification settings - Fork 3
Control Flow
Andrew Johnson edited this page Nov 13, 2024
·
7 revisions
LSTS offers a standard assortment of control flow operators.
Ternary if can be used in expression position.
print(if condition then "true" else "false")
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;
})
While loops are a common feature available in most languages.
while x < 2 { x += 1; }
For loops allow the programmer to traverse through iterable data.
for(x in [1,2,3]) { print(x); }
The LSTS source code and documentation are released under the terms of the attached permissive MIT license. This license is intended only to protect the future development of the project while otherwise allowing people to use the code and IP as they would like. Please, just be nice.