การเรนเดอร์th-TH

สาธารณะ

Translation status: ภาษาไทย reader-locale proof. Term names and code fences follow the th-TH pack; supporting prose may still be English.

Marks an import as re-exported from the current module.

Aliases: public

Syntax: นำเข้า ออก <source> สาธารณะ <name>

Category#

modifier

Examples#

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

Marks an import as re-exported from the current module.

# =============================================================================
# สาธารณะ — Marks an import as re-exported from the current module.
# =============================================================================
#
# What this teaches:
#   • Module export visibility — `@ สาธารณะ` (en spelling `@ public`) exports a
#     declaration from the current module, making it importable by any consumer
#   • The opposite of `@ ส่วนตัว`; controls the public API surface of a module
#   • Unmarked top-level declarations are module-private: only `@ สาธารณะ` /
#     `@ ภายในองค์กร` declarations appear in the file's importable surface
#
# Common mistakes:
#   • Leaving a declaration unmarked and expecting it to be importable — the
#     export surface is `@ สาธารณะ` / `@ ภายในองค์กร` only.
#
# See also: ส่วนตัว, นำเข้า
# =============================================================================

# @ สาธารณะ marks a declaration as public metadata
#
# Annotations attach visibility metadata to the following declaration.
#
# GRAMMAR:
#   annotatedDecl :← '@' 'สาธารณะ' funcDecl
#
# EXPECTED OUTPUT:
#   สาธารณะ

@ public { }
fn publicum() → string {
    return "publica"
}

main {
    print publicum()
}

Expected output:

publica