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
(begin (display "answer=") (write 42) (newline) 0)Observed result
answer=42
0Read the example
display writes string contents, write uses canonical guest notation for
42, 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
displayleaves strings unquoted and prints characters as glyphs;writeuses round-readable quotes, escapes, and character notation.- All four procedures return zero values. Explicit output stays ordered with CLI auto-print, while receipts keep completed root values as a separate projection.
- 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.
Choose quickly
| Operation | Available inside Lispex? | Alternative |
|---|---|---|
| canonical value output | yes: write | use when round-readable notation matters |
| human-oriented text output | yes: display, newline, println | order is deterministic |
| file or network access | no | perform it in an explicit calling boundary |
| clock or randomness | no | supply a chosen value as input |
| external action from a decision | no | authorize 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 is bounded. There are no ambient ports, files, or network handles behind these procedures.
- Target-language emission is not a Lispex execution mode.
Keep going
Choosing a Runtime shows which product surface fits the host boundary. Decision Rules shows how to return labelled data instead of performing an action.