lege
Translation status: ภาษาไทย reader-locale proof. Code fences render through the th-TH pipeline; prose is canonical Latin.
Reads input from the active input stream.
Syntax: lege [lineam]
Category#
io
Related#
Examples#
radix/corpus/lege/lege.fab (canonical · keyword)#
Reads input from the active input stream.
# =============================================================================
# lege — Reads input from the active input stream.
# =============================================================================
#
# What this teaches:
# • stdin input with `lege` — reads one line from the active input stream
# • the `↦ regex` conversion — compiling a textus pattern into a regex value
#
# Common mistakes:
# • Not checking is null before using the value — read may return null at end of input.
#
# See also: lineam, scribe
# =============================================================================
# lege and regex conversio — I/O read and compiled pattern expressions
#
# fixum _ pattern ← "\d+" ↦ regex -- compiled regex from textus
# fixum _ input ← lege -- stdin line read
#
# GRAMMAR:
# conversio :← stringLit '↦' 'regex'
# readExpr :← 'lege'
#
# EXPECTED OUTPUT:
# Regex pattern diagnostic, then one stdin line (no .expected — interactive).
#
# BACKEND: Rust/Go/roundtrip e2e whitelist — lege not yet lowered for Rust/Go
# (whitelist: lege/lege.fab).
main {
const _ pattern ← "(?g)\d+" ↦ regex
print pattern
const _ input ← read
print input
}