渲染zh-Hant

入口

Translation status: 繁體中文 reader-locale proof. Term names and code fences follow the zh-Hant pack; supporting prose may still be English.

Declares the synchronous program entry point.

Aliases: main, entry

Syntax: 入口 <block>

Category#

function

Examples#

radix/corpus/incipit/incipit.fab (canonical · keyword)#

Declares the synchronous program entry point.

test "do nothing deliberately" {
    pass
}
# =============================================================================
# 入口 — Declares the synchronous program entry point
# =============================================================================
#
# What this teaches:
#   • Declares the synchronous program entry point.
#   • Related keywords: 函式, 匯入
#
# Common mistakes:
#   • Attaching `@ cli` to a non-`入口` declaration — `@ cli` may only annotate an `入口` entry point (SEM009).
#
# See also: 函式, 匯入
# =============================================================================

# 入口 — basic program entry point
#
# 入口 { <body> }
#
# GRAMMAR:
#   entryBlock :← '入口' block
#
# EXPECTED OUTPUT:
#   none — smoke asserts exit 0; entry diagnostic via 註記.
#
# BACKEND:
#   Contrast with salve-munde.fab (module-scope 註記), functionibus.fab
#   (calls module-level 函式), and cli/cli.fab (入口 引數).

main {
    print "ingressus"
}

Expected output:

ingressus