true # Boolean
1 # Integer
1.2 # Floating Point Integer
"abc" # String
'a' # Character
r/a*b+c/ # Regular Expression
arr[i] # Get one item
arr[i:j] # Get slice from i until j
arr[:j] # Get slice from start until j
arr[i:] # Get slice from i until end
arr[i:-2] # Get slice from i until 2 items before end
do-this(); # The semi-colon separates expressions into an ordered sequence
before-this();
if x then y;
if x then y else z;
if x { y };
if x { y } else { z };
while condition { do-a-thing; };
for x in y { do-a-thing; };
match a {
lhs => rhs;
"abc" => "def"; # match a string value "abc"
"ab".. rest => "c"; # match a string starting with "ab"
[1.. 2..] => 3 # this lhs will match only a two element sequence [1,2]
[1.. 2.. _] => 3 # this lhs will match any sequence starting with 1 and 2
A { binding=key:5 } => 4; # this will match a struct A with field "key" having value 5
};
let f(a: A, b: B): C = c(a, b);
let .f(this: A, b: B): C = c(this, b);
type AB = CaseA { x: U64 } | CaseB { y: U64 };