funraw

package
v1.57.0 Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2026 License: BSD-3-Clause Imports: 2 Imported by: 0

Documentation

Overview

Package funraw grants in-repo tooling access to the environment captured by a lisp function value.

lisp.LVal's FunData/Env accessors went unexported in issue #382: the captured environment was the deepest aliasing channel left in the exported API — an *LEnv handed to an embedder reaches the bindings of every closure sharing it, and rebinding one (Put, or the scope map itself before the same issue unexported it) is invisible to the seal. Function identity stays on the exported surface (FID, Package, Builtin are string/ func reads), but the environment itself is now reachable only through this package: it lives under internal/, so the Go compiler limits it to this module — the debugger classifies user-defined functions and the profiler resolves display names, and an embedder importing elps cannot reach the captured environment at all.

The accessor is injected by package lisp's init through the untyped slot in the hook subpackage (see hook's doc comment for the cycle it breaks). Callers MUST treat the returned environment and everything reachable from it as read-only.

Index

Constants

This section is empty.

Variables

View Source
var Env func(v *lisp.LVal) *lisp.LEnv

Env returns the environment captured by the function value v (nil for builtins, for LFun values carrying no function data, and for non-function values). The returned environment is the closure's own — read-only by contract. Injected by package lisp's init; importing this package imports lisp, so the accessor is always non-nil by the time user code runs.

Functions

This section is empty.

Types

This section is empty.

Directories

Path Synopsis
Package hook is the untyped injection slot behind internal/funraw.
Package hook is the untyped injection slot behind internal/funraw.

Jump to

Keyboard shortcuts

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