渲染zh-Hant

欄位

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

Declares one typed column inside a schema body (experimental).

Aliases: column

Syntax: 欄位 <type> <name> (: <sourceName>)?

Category#

declaration

Examples#

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

Declares one typed column inside a schema body (experimental).

# =============================================================================
# 欄位 — Declares one typed column inside a 結構 body (experimental)
# =============================================================================
#
# What this teaches:
#   • Column rows — each `欄位` takes a type and a public name, one row per line.
#   • Source alias — `: sourceName` maps the public column to a differently named source column.
#   • Nullable columns — a column that may be absent is typed `T ∪ none`.
#
# Common mistakes:
#   • Putting two columns on one line — each `欄位` row starts on its own line.
#
# See also: 結構
# =============================================================================

# 欄位 — typed 結構 column
#
# GRAMMAR:
#   schemaColumn :← '欄位' typeAnnotation IDENTIFIER (':' IDENTIFIER)?
#
# EXPECTED OUTPUT:
#   columns declared

結構 Persona {
    column string 名稱
    column int aetas : years
    column string ∪ none electronica : email
}

main {
    print "columns declared"
}

Expected output:

columns declared