# Functions
Assoc takes a container, a key and value, and returns a modified version of the container, in which the key associated with the value.
Bool converts a value to bool.
CanIterate returns whether the value can be iterated.
Cmp compares two Elvish values and returns the ordering relationship between them.
CmpTotal is similar to [Cmp], but uses an artificial total ordering to avoid returning [CmpUncomparable]:
- If a and b have different types, it compares their types instead.
Collect collects all elements of an iterable value into a slice.
Concat concatenates two values.
ConvertListIndex parses a list index, check whether it is valid, and returns the converted structure.
ConvertToFloat64 converts any number to float64.
Dissoc takes a container and a key, and returns a modified version of the container, with the given key dissociated with any value.
Equal returns whether two values are equal.
Feed calls the function with given values, breaking earlier if the function returns false.
FromGo converts a Go value to an Elvish value.
Hash returns the 32-bit hash of a value.
HasKey returns whether a container has a key.
Index indexes a value with the given key.
Int64ToNum converts an int64 to a Num with a suitable underlying representation.
Iterate iterates the supplied value, and calls the supplied function in each of its elements.
IterateKeys iterates the keys of the supplied value, calling the supplied function for each key.
Kind returns the "kind" of the value, a concept similar to type but not yet very well defined.
Len returns the length of the value, or -1 if the value does not have a well-defined length.
MakeList creates a new List from values.
MakeListSlice creates a new List from a slice.
MakeMap creates a map from arguments that are alternately keys and values.
NewListReprBuilder makes a new ListReprBuilder.
NewMapReprBuilder makes a new MapReprBuilder.
NormalizeBigInt converts a big.Int to an int if it is within the range of int.
NormalizeBigRat converts a big.Rat to a big.Int (or an int if within the range) if its denominator is 1.
NoSuchKey returns an error indicating that a key is not found in a map-like value.
Optional wraps the last pointer passed to ScanListElementsToGo, to indicate that it is optional.
ParseNum parses a string into a suitable number type.
PromoteToBigInt converts an int or *big.Int to a *big.Int.
PromoteToBigRat converts an int, *big.Int or *big.Rat to a *big.Rat.
Repr returns the representation for a value, a string that is preferably (but not necessarily) an Elvish expression that evaluates to the argument.
ReprPlain is like Repr, but without pretty-printing.
ScanListElementsToGo unpacks elements from a list, storing the each element in the given pointers with ScanToGo.
ScanListToGo converts a List to a slice, using ScanToGo to convert each element.
ScanMapToGo scans map elements into ptr, which must be a pointer to a struct.
ScanToGo converts an Elvish value, and stores it in the destination of ptr, which must be a pointer.
StructFieldsInfo takes a type for a struct, and returns a slice for each field name, converted with CamelToDashed, and a reverse index.
TestValue returns a ValueTester.
ToString converts a Value to string.
TypeOf is like reflect.TypeOf, except that when given an argument of nil, it does not return nil, but the Type for the empty interface.
Uint64ToNum converts a uint64 to a Num with a suitable underlying representation.
UnifyNums unifies the given slice of numbers into the same type, converting those with lower NumType to the highest NumType present in the slice.
UnifyNums2 is like UnifyNums, but is optimized for two numbers.
ValueOf is like reflect.ValueOf, except that when given an argument of nil, it does not return a zero Value, but the Value for the zero value of the empty interface.
# Constants
PromoteToBigInt converts an int or *big.Int to a *big.Int.
PromoteToBigInt converts an int or *big.Int to a *big.Int.
Possible Ordering values.
Possible Ordering values.
Possible Ordering values.
Possible Ordering values.
PromoteToBigInt converts an int or *big.Int to a *big.Int.
PromoteToBigInt converts an int or *big.Int to a *big.Int.
# Variables
EmptyList is an empty list.
EmptyMap is an empty map.
ErrConcatNotImplemented is a special error value used to signal that concatenation is not implemented.
# Structs
ListIndex represents a (converted) list index.
ListReprBuilder helps to build Repr of list-like Values.
MapReprBuilder helps building the Repr of a Map.
Pipe wraps a pair of [*os.File] that are the two ends of a pipe.
Tester is a helper for testing properties of a value.
WrongType is returned by ScanToGo if the source value doesn't have a compatible type.
# Interfaces
Assocer wraps the Assoc method.
Booler wraps the Bool method.
Concatter wraps the Concat method.
Dissocer wraps the Dissoc method.
Equaler wraps the Equal method.
ErrIndexer wraps the Index method.
Hasher wraps the Hash method.
HasKeyer wraps the HasKey method.
Indexer wraps the Index method.
Iterator wraps the Iterate method.
KeysIterator wraps the IterateKeys method.
Kinder wraps the Kind method.
Lener wraps the Len method.
PseudoMap may be implemented by a type to support map-like introspection.
RConcatter wraps the RConcat method.
Reprer wraps the Repr method.
Stringer wraps the String method.
StructMap may be implemented by a struct to make it accessible to Elvish code as a map.
# Type aliases
List is an alias for the underlying type used for lists in Elvish.
Map is an alias for the underlying type used for maps in Elvish.
Num is a stand-in type for int, *big.Int, *big.Rat or float64.
NumSlice is a stand-in type for []int, []*big.Int, []*big.Rat or []float64.
NumType represents a number type.
Ordering relationship between two Elvish values.