rootlibrary

package
v1.62.0 Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2026 License: BSD-3-Clause Imports: 5 Imported by: 0

Documentation

Overview

Package rootlibrary provides the confined source loader shared by the CLI execution commands and the REPL.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RelativePath

func RelativePath(root, loc string) (string, error)

RelativePath strips an absolute root prefix without cleaning the unresolved request. Relative requests are passed through for os.Root to check at open time.

Types

type Library

type Library struct {
	// contains filtered or unexported fields
}

Library reads sources through an open directory handle. Close it after all evaluations using the library have finished.

func Open

func Open(dir string) (*Library, error)

Open anchors a library to dir, or the working directory when dir is empty.

func (*Library) Close

func (lib *Library) Close() error

Close releases the root directory handle.

func (*Library) LoadSource

func (lib *Library) LoadSource(ctx lisp.SourceContext, loc string) (string, string, []byte, error)

LoadSource anchors initial loads at the root and nested loads at the calling source's directory. The root handle enforces confinement at read time.

Jump to

Keyboard shortcuts

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