-
Notifications
You must be signed in to change notification settings - Fork 0
Control Flow
Nika Natsvlishvili edited this page Dec 29, 2025
·
1 revision
Logos uses discern and otherwise for conditional logic.
inscribe gold = 10;
discern (gold > 100) {
proclaim "We are wealthy.";
} otherwise {
proclaim "We must live humbly.";
} amenRepetitive tasks are handled by chant (equivalent to while).
inscribe i = 0;
chant i < 5 {
proclaim i;
amend i = i + 1;
} amenA powerful alternative to switch or if/else chains. Use aspect to match values and _ for wildcards.
inscribe status = 200;
contemplate (status) {
aspect 200: proclaim "OK";
aspect 404: proclaim "Not Found";
aspect _: proclaim "Unknown State";
} amen