I/O, Capabilities, and Explicit Effects

The pure executable profile keeps host effects outside ordinary evaluation and exposes only pinned output behavior in the reference runtime.

When this matters

This page sets the line between deterministic guest evaluation and host effects. Use the built-in output procedures for explicit text output. Keep files, network, time, randomness, and external actions in the calling application.

See it run

LISPEX
(begin (display "answer=") (write 42) (newline) 0)

Observed result

OUTPUT
answer=42
0

Read the example

display writes string contents. write prints 42 in the guest notation that can be read back, and newline appends one line break. println is exactly display followed by that line break. The final 0 is the program result printed by the CLI, so it appears after the explicit output.

How to reason about it

  • display leaves strings unquoted and prints characters as glyphs, while write uses quotes, escapes, and character notation that can be read back.
  • All four procedures return zero values. Explicit output stays ordered with CLI auto-print, while receipts keep completed root values in a separate record.
  • Output already written remains visible if a later expression fails.
  • CLI file/stdin selection and source labels are invocation concerns, not new language bindings.
  • External capabilities must be explicit and versioned rather than discovered by a host-global fallback.
  • Native MCP, the local server an assistant connects to, grants none of these capabilities. lispex_eval receives source and an optional datum through local stdio and returns observations under fixed size and time limits.

Choose quickly

OperationAvailable inside Lispex?Alternative
value output that can be read backyes, use writechoose it when the printed form must parse again
human-oriented text outputyes, use display, newline, printlnorder is deterministic
file or network accessnoperform it in an explicit calling boundary
clock or randomnessnosupply a chosen value as input
external action from a decisionnoauthorize and execute it in consumer code

A common mistake

Ports, filesystem, networking, time, randomness, and unrestricted host evaluation are not in the current pure profile.

Current boundaries

  • The output buffer has a fixed size limit. There are no hidden ports, files, or network handles behind these procedures.
  • Target-language emission is not a Lispex execution mode.

Keep going

Choosing Where to Run shows which way of running Lispex fits your host boundary. Decision Rules shows how to return labelled data instead of performing an action.

Choosing Where to Run · Running and Checking Decision Records