渲染zh-Hans

vacuum

Translation status: 简体中文 reader-locale proof. Code fences render through the zh-Hans pipeline; prose is canonical Latin.

Primitive no-value return type.

Aliases: void, unit

Syntax: vacuum

Category#

type

Examples#

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

Primitive no-value return type.

# =============================================================================
# vacuum — Primitive no-value return type.
# =============================================================================
#
# What this teaches:
#   • Void return — `vacuum` for functions that produce no value
#   • Side-effect functions — functions returning `vacuum` execute for their side effects like `nota`
#
# Common mistakes:
#   • confusing vacuum (void return type) with vacua (empty collection initializer) or nihil (null singleton)
#
# See also: functio, redde
# =============================================================================



# vacuum — void return type
#
# GRAMMAR:
#   returnType :← 'vacuum'
#
# EXPECTED OUTPUT:
#   Scalar stdout smoke (see body).
#

fn log(string message)  void {
    print message
}

main {
    log("vacuum smoke")
}

Expected output:

vacuum smoke