mirror of
https://github.com/ProgramSnail/Lama.git
synced 2025-12-05 22:38:44 +00:00
16 lines
577 B
Text
16 lines
577 B
Text
printf ("if, case, for, while etc. are all expressions.\n");
|
|
|
|
printf ("Case-expression: %s\n", case A (1, 2, 3) of A (x, y, z) -> z esac.string);
|
|
|
|
printf ("If-expression: %s\n", (if true then 2 else 3 fi +
|
|
if false then 6 else 7 fi).string);
|
|
|
|
printf ("Scope-expression: %s\n", (var i, s = 0;
|
|
for i := 0, i < 10, i := i + 1 do
|
|
s := s + i
|
|
od;
|
|
s
|
|
).string
|
|
)
|
|
|
|
|