Skip to main content

Crate grift_repl

Crate grift_repl 

Source
Expand description

§Grift REPL

A Read-Eval-Print-Loop for the Grift R7RS-compliant Scheme interpreter.

§Features

  • Rich error display with stack traces
  • Line editing with arrow keys (via rustyline)
  • GC commands and statistics
  • Help system
  • Output callback for side effects during macro expansion
  • Integrated StdIoProvider from grift_std for port-based I/O (stdin, stdout, stderr, and dynamic string ports)

§Usage

use grift_repl::run_repl;

run_repl::<10000>();

Structs§

Arena
Fixed-size arena allocator with O(1) allocation.
ArenaIndex
Index into the arena.
DisplayValue
A wrapper that enables core::fmt::Display for Lisp values.
EvalError
Evaluation error with context - optimized for minimal size.
Evaluator
The Lisp evaluator with full trampolined TCO.
GcStats
Statistics returned by garbage collection.
Lisp
A Lisp execution context wrapping an arena
ParseError
Parser error with location
Repl
The REPL structure (for API convenience)
SourceLoc
Source location for error reporting
StackFrame
A stack frame for error reporting

Enums§

ArenaError
Errors that can occur during arena operations.
Builtin
Built-in functions (optimization to avoid symbol lookup)
ErrorKind
Error kind enumeration
ParseErrorKind
StdLib
Standard library functions (stored in static memory, not arena)
Value
A Lisp value

Traits§

Trace
Trait for types that can be traced by the garbage collector.

Functions§

eval_to_string
Evaluate a string and return the result as a string
format_error
Format an evaluation error with full context
format_value
Format a Lisp value as a string
is_only_comments_and_whitespace
Check if a string contains only comments and whitespace.
parse
Parse a string into a Lisp expression
run_repl
Run a REPL session
value_to_string
Convert a Lisp value to a string

Type Aliases§

ArenaResult
Result type for arena operations.
EvalResult
Result type for evaluation