Provisional API: This reference documents current compiler behavior. Compatibility is not yet promised.
src/repl-session.x
Persistent compiler submissions and inspection.
Functions
| Function | Summary |
|---|---|
ReplSession.inspect | Returns (value), (function (typed AST) (lowered FORMS)), or NULL if absent. |
ReplSession.new | Borrows an initialized submission compiler until its unit closes. |
ReplSession.submit | Submits one complete candidate without printing or retaining a pending prefix. |
ReplSession.symbols | Returns an immutable snapshot of (kind “name”) entries, sorted by name. |
ReplSession
ReplSession.inspect
List ReplSession.inspect(ReplSession session, String name)
Returns (value), (function (typed AST) (lowered FORMS)), or NULL if absent. These are the original canonical Lists, borrowed until unit close.
Source: src/repl-session.x:61
ReplSession.new
ReplSession ReplSession.new(Compiler compiler)
Borrows an initialized submission compiler until its unit closes. Source-fact collection must be disabled because submission scratch maps are reclaimed after each call.
Source: src/repl-session.x:36
ReplSession.submit
ReplResult ReplSession.submit(ReplSession session, String source)
Submits one complete candidate without printing or retaining a pending prefix. Only successfully initialized declarations publish new bindings; evaluation effects on previously published values survive failure.
Source: src/repl-session.x:158
ReplSession.symbols
List ReplSession.symbols(ReplSession session)
Returns an immutable snapshot of (kind “name”) entries, sorted by name. Only session definitions appear; storage is borrowed until unit close.
Source: src/repl-session.x:48
Public types
| Type | Kind | Summary |
|---|---|---|
ReplResult | struct | status is incomplete, rejected, defined, executed, value, or failed. |
ReplSession | struct | The caller keeps the compiler’s unit Context open until every result and this session are finished. |
ReplResult
typedef struct ReplResult { Symbol status; Var value; String name, message, source; List diagnostics, cause, syntax, lowered; } ReplResult
status is incomplete, rejected, defined, executed, value, or failed. diagnostics are ordinary compiler reports; message/cause describe the adapter or evaluator failure. source retains diagnostic source text; syntax and lowered support optional tracing.
Source: src/repl-session.x:19
ReplSession
typedef struct ReplSession { Compiler compiler; Map names; } *ReplSession
The caller keeps the compiler’s unit Context open until every result and this session are finished. Results borrow that Context’s storage.
Source: src/repl-session.x:10