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 ¶
- type Lists
- func (l Lists) All() iter.Seq[Pair]
- func (l Lists) At(key string, i int) string
- func (l Lists) Copy() map[string][]string
- func (l Lists) Keys() []string
- func (l Lists) Len() int
- func (l Lists) List(key string) iter.Seq[string]
- func (l Lists) ListLen(key string) int
- func (l Lists) Span(key string) (int, int)
- func (l Lists) ValueAt(i int) string
- type Map
- type Pair
- type Scalar
- type Strings
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Lists ¶ added in v1.81.0
type Lists struct {
// contains filtered or unexported fields
}
Lists is a read-only string-keyed table of name lists. Its zero value is an empty table. A list is never handed out: callers read it by index. The table is one slice of pairs sorted by key, then value, so a table of any size is one allocation.
func AdoptPairs ¶ added in v1.81.0
AdoptPairs takes ownership of pairs, sorts them by key, then value, and returns them as a table: each key's list is its pairs' values in order. The caller must not use pairs after the call.
func NewLists ¶ added in v1.81.0
NewLists takes a private snapshot of the table and of every list; the caller keeps ownership of values. Each list must be sorted.
func (Lists) Copy ¶ added in v1.81.0
Copy returns a mutable copy of the table and of every list, never the backing storage.
func (Lists) ListLen ¶ added in v1.81.0
ListLen returns the length of the list stored under key, 0 when none is.
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 ¶
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.
type Pair ¶ added in v1.81.0
type Pair struct {
Key, Value string
}
Pair is one entry of a Lists table: Value is in the list of Key.
type Scalar ¶
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
AdoptStrings takes ownership of values without copying. The caller must hold no other reference to the backing slice, as with AdoptMap.
func NewStrings ¶
NewStrings takes a private snapshot; the caller keeps ownership of values.