repl

package
v1.22.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 25, 2026 License: BSD-3-Clause Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RunEnv

func RunEnv(env *lisp.LEnv, prompt, cont string, opts ...Option)

RunEnv runs a simple repl with env as a root environment.

func RunRepl

func RunRepl(prompt string, opts ...Option)

RunRepl runs a simple repl in a vanilla elps environment.

Types

type Option added in v1.16.3

type Option func(*config)

func WithBatch added in v1.16.14

func WithBatch(enabled bool) Option

WithBatch enables batch mode. The readline prompt and terminal manipulation are suppressed and raw lines are read from stdin. Batch mode auto-enables JSON output unless explicitly overridden.

func WithEval added in v1.16.14

func WithEval(expr string) Option

WithEval sets a single expression to evaluate. The REPL evaluates the expression, prints the result, and exits.

func WithJSON added in v1.16.14

func WithJSON(enabled bool) Option

WithJSON enables JSON output mode. Each evaluation result is emitted as a single-line JSON object to stdout.

func WithRootDir added in v1.20.0

func WithRootDir(dir string) Option

WithRootDir confines file access to the given directory tree. When empty, the working directory is used as the root.

func WithStderr added in v1.16.3

func WithStderr(stderr io.WriteCloser) Option

WithStderr allows overriding the output to the REPL.

func WithStdin added in v1.16.3

func WithStdin(stdin io.ReadCloser) Option

WithStdin allows overriding the input to the REPL.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL