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 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
displayleaves strings unquoted and prints characters as glyphs, whilewriteuses 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_evalreceives source and an optional datum through local stdio and returns observations under fixed size and time limits.
Choose quickly
| Operation | Available inside Lispex? | Alternative |
|---|---|---|
| value output that can be read back | yes, use write | choose it when the printed form must parse again |
| human-oriented text output | yes, use 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 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