Help us shape the future of Go! Take the 2026 Go Developer Survey

packagetable

package
v1.77.0 Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2026 License: BSD-3-Clause Imports: 3 Imported by: 0

Documentation

Overview

Package packagetable owns frozen package storage. Its private backing fields make writes through the lisp kernel's read accessors a compile-time error.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Map

type Map[V Scalar] struct {
	// contains filtered or unexported fields
}

Map is a read-only string-keyed table. Its zero value is an empty table.

func AdoptMap

func AdoptMap[V Scalar](values map[string]V) Map[V]

AdoptMap takes ownership of values without copying. The caller must hold no other reference to values; it is for a map the caller has just built.

func NewMap

func NewMap[V Scalar](values map[string]V) Map[V]

NewMap takes a private snapshot; the caller keeps ownership of values.

func (Map[V]) All

func (m Map[V]) All() iter.Seq2[string, V]

All visits entries in key order.

func (Map[V]) Copy

func (m Map[V]) Copy() map[string]V

Copy returns a mutable copy, never the backing map.

func (Map[V]) Keys

func (m Map[V]) Keys() []string

Keys returns a fresh, sorted list of keys.

func (Map[V]) Len

func (m Map[V]) Len() int

Len returns the number of entries.

func (Map[V]) Lookup

func (m Map[V]) Lookup(key string) (V, bool)

Lookup returns an entry and whether it exists.

func (Map[V]) Unordered added in v1.75.0

func (m Map[V]) Unordered() iter.Seq2[string, V]

Unordered visits entries in no fixed order, without allocating. A caller must compute a result that does not depend on the order, such as a minimum.

type Scalar

type Scalar interface {
	~string | ~int
}

Scalar excludes pointers and other mutable values: a copy of a table entry must not provide a way to modify the table's storage.

type Strings

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

Strings is a read-only list of export names in declaration order. Its zero value is an empty list.

func AdoptStrings added in v1.73.0

func AdoptStrings(values []string) Strings

AdoptStrings takes ownership of values without copying. The caller must hold no other reference to the backing slice, as with AdoptMap.

func NewStrings

func NewStrings(values []string) Strings

NewStrings takes a private snapshot; the caller keeps ownership of values.

func (Strings) All

func (s Strings) All() iter.Seq[string]

All visits names in declaration order, including duplicates.

func (Strings) Copy

func (s Strings) Copy() []string

Copy returns a mutable copy, never the backing slice.

func (Strings) Len

func (s Strings) Len() int

Len returns the number of names.

Jump to

Keyboard shortcuts

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