Skip to main content

Module render

Module render 

Source
Expand description

Solution rendering: the readable text form (term_to_string) plus the raw term word the bson encoder walks. (No JSON rendering — the engine speaks text + bson; JSON, if a host wants it, is derived from bson at the host boundary. docs/design/IO.md.)

Structs§

Binding
One query-variable binding, materialized at solution time. word is the already-dereferenced value term (zero extra computation over producing the text); the bson encoder walks it via copyterm::copy_to_buf.
RenderedSolution
One captured solution: bindings sorted by variable name (v1 rule), rendered immediately (terms are undone by backtracking afterwards).

Functions§

capture_solution
Capture the current solution from the machine’s query variables.
format_term
v1’s format_term rendering: plain functional notation (no infix), atoms unquoted, vars _<idx>, lists [a, b|T]. This is the byte contract for error messages (“Runtime error: error(…)”).
term_to_string
term_to_string_quoted
writeq/1 rendering: like term_to_string but atoms that wouldn’t read back unquoted are single-quoted (issue #33). Used only by writeq/1.