# 한 줄 함수
F add(a:i64,b:i64)->i64=a+b
# 재귀 호출: @ = 현재 함수
F fib(n:i64)->i64=n<2?n:@(n-1)+@(n-2)
# 블록 함수
F process(data:[i64])->i64{
sum:=0
L i:data{sum+=i} # Loop
sum
}
# 제네릭
F swap<T>(a:&T,b:&T){t:=*a;*a=*b;*b=t}
# 조건문 (삼항 연산자 확장)
x<0?-1:x>0?1:0
# If 블록
I x<0{-1}E x>0{1}E{0}
# Loop
L i:0..10{print(i)} # range
L item:list{print(item)} # iterator
L{break?condition} # while
# Match
M value{
0=>zero
1..10=>small
_=>other
}
# Struct
S Point{x:f64,y:f64}
# Enum
E Option<T>{Some(T),None}
E Result<T,E>{Ok(T),Err(E)}
# 메서드
S Point{x:f64,y:f64}
F len(&self)->f64=(self.x*self.x+self.y*self.y).sqrt()
F = function
S = struct
E = enum
I = if
E = else (context-dependent)
L = loop
M = match
A = async
R = return
B = break
C = continue
T = type alias
U = use/import
P = pub (public)