universe

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package universe owns the fixed Starlark language surface.

Every execution receives a fresh predeclared dictionary containing numeric sum, a filtered json module with decode, encode, and indent, and the pinned math module. Query helpers return copied sorted name lists for documentation and reserved-root checks. Capability namespaces merge only after IsReservedRoot rejects colliding roots. Nested leaves such as stats.sum remain legal. There is no built-in time module.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsReservedRoot

func IsReservedRoot(name string) bool

IsReservedRoot reports whether name is a forbidden top-level capability namespace.

Name is the first dotted segment only. Nested leaves such as stats.sum remain legal. Membership includes every standard Starlark universe name, including dialect-gated set, plus sum, json, and math.

func JSONMemberNames

func JSONMemberNames() []string

JSONMemberNames returns a sorted copy of the selected json module members.

func MathMemberNames

func MathMemberNames() []string

MathMemberNames returns a sorted copy of the pinned math module members.

func Predeclared

func Predeclared() starlark.StringDict

Predeclared returns a fresh dictionary of the fixed language surface.

The dictionary itself is unfrozen so callers can merge capability namespaces. Member values are shared across calls: sum is a shared builtin, json is a shared filtered module, and math is the pinned math.Module. Freezing the returned dictionary therefore freezes those shared values.

func TopLevelNames

func TopLevelNames() []string

TopLevelNames returns a sorted copy of the documented available top-level names.

The list includes standard Starlark universe names except set, which is reserved but unavailable under the execution dialect, plus sum, json, and math.

Types

This section is empty.

Jump to

Keyboard shortcuts

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