repl

package
v0.0.0-...-7aee52b Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2026 License: MIT Imports: 16 Imported by: 0

Documentation

Overview

Package repl is an interactive evaluator for Writ source.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type REPL

type REPL struct {
	In  io.Reader
	Out io.Writer
	Err io.Writer
	RT  *writ.Runtime
	// HistoryFile is the readline history path. Empty uses the user
	// config directory. Readline is used only when In is a terminal.
	HistoryFile string
}

REPL evaluates forms from In until EOF or the context is cancelled.

func (REPL) Run

func (r REPL) Run(ctx context.Context) error

Run reads forms until EOF or ctx is done. One Runtime is used for the session. Parse and eval errors are written to Err and the session continues. EOF returns nil. Cancelled ctx returns ctx.Err().

Jump to

Keyboard shortcuts

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