publica
Translation status: 简体中文 reader-locale proof. Code fences render through the zh-Hans pipeline; prose is canonical Latin.
Marks an import as re-exported from the current module.
Aliases: public
Syntax: importa ex <source> publica <name>
Category#
modifier
Related#
Examples#
radix/corpus/publica/publica.fab (canonical · keyword)#
Marks an import as re-exported from the current module.
# =============================================================================
# publica — Marks an import as re-exported from the current module.
# =============================================================================
#
# What this teaches:
# • Module export visibility — `@ publica` re-exports a declaration from the
# current module, making it accessible to external consumers
# • The opposite of `@ privata`; controls the public API surface of a module
#
# Common mistakes:
# • Expecting `@ publica` to enforce access control — visibility annotations are decorative only (WARN012).
#
# See also: privata, importa
# =============================================================================
# @ publica marks a declaration as public metadata
#
# Annotations attach visibility metadata to the following declaration.
#
# GRAMMAR:
# annotatedDecl :← '@' 'publica' funcDecl
#
# EXPECTED OUTPUT:
# publica
@ public
fn publicum() → string {
return "publica"
}
main {
print publicum()
}Expected output:
publica