Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Keyword Reference

Control Keywords

KeywordEnglishSyntax
함수function함수 이름(매개변수: 타입) -> 반환타입 { }
반환return반환 값
변수let (mutable)변수 이름 = 값
상수const상수 이름 = 값
만약if만약 조건 이면 { }
이면then/if-then만약 조건 이면 { }
아니면else아니면 { } or 아니면 조건 이면 { }
그리고and (logical)a 그리고 b
또는or (logical)a 또는 b
반복for반복 변수 i = 0; i < n; i += 1 { }
동안while조건 동안 { } or 동안 조건 { }
멈춰break멈춰
계속continue계속
안에서in (for-in)반복 x 안에서 배열 { }

Type Keywords

KeywordEnglishLLVM
정수inti64
실수floatf64/double
문자열stringi8*
booli1
없음void/nullvoid

Structure Keywords

KeywordEnglishSyntax
구조struct구조 이름 { 필드: 타입 }
구현impl구현 구조체 { 함수 메서드(자신: T) { } }
열거enum열거 이름 { 변형1, 변형2 }
시도try시도 { } 처리(오류) { }
처리catch처리(오류) { }
맞춤match맞춤 값 { 패턴 => 결과 }
포함import포함 "파일.hgl"

Literal Keywords

KeywordEnglish
true
거짓false
없음null/void

Built-in Functions

FunctionSignatureDescription
출력(값)(any...) -> 없음Print to stdout
입력()() -> 문자열Read line from stdin
제곱근(x)(숫자) -> 실수Square root
절댓값(x)(숫자) -> 숫자Absolute value
거듭제곱(밑, 지수)(숫자, 숫자) -> 실수Power
정수변환(x)(any) -> 정수Convert to integer
실수변환(x)(any) -> 실수Convert to float
길이(s)(문자열) -> 정수String length
형식(template, ...)(문자열, any...) -> 문자열Format string
파일읽기(경로)(문자열) -> 문자열Read file
파일쓰기(경로, 내용)(문자열, 문자열) -> 없음Write file
파일추가(경로, 내용)(문자열, 문자열) -> 없음Append to file
파일존재(경로)(문자열) -> 불File exists
출력오류(값)(any...) -> 없음Print to stderr