Renderingen-US

Experimental through version 1. Version 0 was alpha. This is the first language release: the interface is relatively stable, not frozen. Nothing is promised stable until version 2.

line

Translation status: English reader-locale proof. Term names and code fences follow the en pack; supporting prose may still be English.

Reads one line of input.

Syntax: read line

Category#

console

Examples#

radix/corpus/reference/keyword/lineam/lineam-stdin.fab (canonical · keyword)#

Reads one line of stdin without its terminator; none at end of input.

# =============================================================================
# line — Reads one line from stdin without its terminator.
# =============================================================================
#
# What this teaches:
#   • successive line reads — the read at EOF produces none
#
# Common mistakes:
#   • Treating line as including the line terminator.
#
# See also: lineam.fab, read
# =============================================================================

main {
    let _ a ← line
    let _ b ← line
    let _ c ← line
    print a
    print b
    print c
}

Expected output:

one
two
none

radix/corpus/reference/keyword/lineam/lineam.fab (canonical · keyword)#

Reads one line of input.

# =============================================================================
# line — Reads one line of input.
# =============================================================================
#
# What this teaches:
#   • line-oriented input mode — `read line` reads a single line from stdin
#
# Common mistakes:
#   • Confusing line (reads one line without trailing newline) with print (writes diagnostic output with newline).
#
# See also: read
# =============================================================================

# line — line-oriented read read
#
# GRAMMAR:
#   readMode :← 'read' 'line'
#
# EXPECTED OUTPUT:
#   Scalar stdout smoke (see body).
#
# BACKEND:
#   Rust/Go/roundtrip whitelist like read/lege.fab.
#

main {
    print "lineam exemplum — stdin read deferred in harness"
}

Expected output:

lineam exemplum — stdin read deferred in harness