Language Reference › $input Systemv0.1
Language Reference

$input System

Read user input interactively or via inline values and files.

Syntax Forms

SyntaxDescription
$inputRead a value, auto-detect type
$input as numberRead and convert to number
$input as stringRead as string
$input as listRead as list
$input as boolRead as boolean
$input("prompt")Show prompt, then read
$input("prompt") as numberShow prompt with typed input

Type keywords accepted

number, string, list, bool, int, float, text

Examples

pseudo
name = $input("Enter your name:")
age = $input("Enter age:") as number

print "Hello, {name}! You are {age} years old."
Output
? Enter your name: → Alice ? Enter age: → 25 Hello, Alice! You are 25 years old.

Auto Type Detection

When no type is specified, $input auto-detects:

Input receivedDetected type
"42"number → 42
"true"bool → true
"hello"string → "hello"

Inline Input (-i flag)

Pass inputs without interactive prompts:

bash
# Single value
pseudo run greet.pseudo -i "Alice"

# Multiple values (\n separates them)
pseudo run greet.pseudo -i "Alice\n25\nengineer"

# From a file
pseudo run greet.pseudo -i inputs.txt

Each $input call consumes the next value in order.

inputs.txt example

inputs.txt
Alice
25
engineer

Repeatable -i

bash
pseudo run program.pseudo -i "Alice" -i "25" -i "engineer"

Input Exhaustion Error

If $input is called but no more inputs are available:

text
✗ Runtime Error: Expected input #4 but no more inputs available.
     Line 12: score = $input