elvish: github.com/elves/elvish/pkg/eval Index | Files | Directories

package eval

import "github.com/elves/elvish/pkg/eval"

Package eval handles evaluation of parsed Elvish code and provides runtime facilities.


Package Files

args_walker.go builtin_fn_cmd.go builtin_fn_cmd_unix.go builtin_fn_container.go builtin_fn_debug.go builtin_fn_env.go builtin_fn_flow.go builtin_fn_fs.go builtin_fn_io.go builtin_fn_misc.go builtin_fn_num.go builtin_fn_pred.go builtin_fn_str.go builtin_fn_styled.go builtin_ns.go builtin_special.go callable.go chdir.go closure.go compilation_error.go compile_effect.go compile_lvalue.go compile_value.go compiler.go deprecation.go editor.go env_list.go eval.go exception.go external_cmd.go frame.go glob.go go_fn.go interrupts.go must.go ns.go options.go port.go port_helper.go process_unix.go purely_eval.go pwd.go resolve.go state.go value_helper.go variable_ref.go


const (
    // FnSuffix is the suffix for the variable names of functions. Defining a
    // function "foo" is equivalent to setting a variable named "foo~", and vice
    // versa.
    FnSuffix = "~"
    // NsSuffix is the suffix for the variable names of namespaces. Defining a
    // namespace foo is equivalent to setting a variable named "foo:", and vice
    // versa.
    NsSuffix = ":"


var (
    // NoArgs is an empty argument list. It can be used as an argument to Call.
    NoArgs = []interface{}{}
    // NoOpts is an empty option map. It can be used as an argument to Call.
    NoOpts = map[string]interface{}{}
var (
    ErrBadGlobPattern          = errors.New("bad GlobPattern; elvish bug")
    ErrCannotDetermineUsername = errors.New("cannot determine user name from glob pattern")

Errors thrown when globbing.

var (
    ErrPathMustBeString           = errors.New("path must be string")
    ErrPathCannotContainColonZero = errors.New(`path cannot contain colon or \0`)


var (
    // ErrExternalCmdOpts is thrown when an external command is passed Elvish
    // options.
    // TODO: Catch this kind of errors at compilation time.
    ErrExternalCmdOpts = errors.New("external commands don't accept elvish options")
    // ErrImplicitCdNoArg is thrown when an implicit cd form is passed arguments.
    ErrImplicitCdNoArg = errors.New("implicit cd accepts no arguments")
var (
    ErrMustFollowWildcard    = errors.New("must follow wildcard")
    ErrModifierMustBeString  = errors.New("modifier must be string")
    ErrWildcardNoMatch       = errors.New("wildcard has no match")
    ErrMultipleTypeModifiers = errors.New("only one type modifier allowed")
    ErrUnknownTypeModifier   = errors.New("unknown type modifier")
var (
    // ErrArgs is thrown when a Go function gets erroneous arguments.
    // TODO(xiaq): Replace this single error type with multiple types that carry
    // richer error information.
    ErrArgs = errors.New("args error")
    // ErrNoOptAccepted is thrown when a Go function that does not accept any
    // options gets passed options.
    ErrNoOptAccepted = errors.New("function does not accept any options")
var (
    // ClosedChan is a closed channel, suitable for use as placeholder channel input.
    ClosedChan = getClosedChan()
    // BlackholeChan is channel writes onto which disappear, suitable for use as
    // placeholder channel output.
    BlackholeChan = getBlackholeChan()
    // DevNull is /dev/null.
    DevNull = getDevNull()
    // DevNullClosedChan is a port made up from DevNull and ClosedChan,
    // suitable as placeholder input port.
    DevNullClosedChan = &Port{File: DevNull, Chan: ClosedChan}
    // DevNullClosedChan is a port made up from DevNull and BlackholeChan,
    // suitable as placeholder output port.
    DevNullBlackholeChan = &Port{File: DevNull, Chan: BlackholeChan}
var DevNullPorts = [3]*Port{
    DevNullClosedChan, DevNullBlackholeChan, DevNullBlackholeChan}

DevNullPorts is 3 placeholder ports.

var ErrBadBase = errors.New("bad base")

ErrBadBase is thrown by the "base" builtin if the base is smaller than 2 or greater than 36.

var ErrImpure = errors.New("expression is impure")
var ErrInputOfEawkMustBeString = errors.New("input of eawk must be string")

ErrInputOfEawkMustBeString is thrown when eawk gets a non-string input.

var ErrInterrupted = errors.New("interrupted")

ErrInterrupted is thrown when the execution is interrupted by a signal.

var ErrNonExistentEnvVar = errors.New("non-existent environment variable")

ErrNonExistentEnvVar is raised by the get-env command when the environment variable does not exist.

var ErrNotInSameProcessGroup = errors.New("not in the same process group")

ErrNotInSameProcessGroup is thrown when the process IDs passed to fg are not in the same process group.

var ErrStoreNotConnected = errors.New("store not connected")

ErrStoreNotConnected is thrown by dir-history when the store is not connected.

var ErrUncomparable = errs.BadValue{
    What:  `inputs to "order"`,
    Valid: "comparable values", Actual: "uncomparable values"}

ErrUncomparable is raised by the order command when inputs contain uncomparable values.

var Getwd func() (string, error) = os.Getwd

Getwd allows for unit test error injection.

var IsBuiltinSpecial = map[string]bool{}

IsBuiltinSpecial is the set of all names of builtin special forms. It is intended for external consumption, e.g. the syntax highlighter.

var OK = &Exception{}

OK is a pointer to the zero value of Exception, representing the absence of exception.

var TimeAfter = func(fm *Frame, d time.Duration) <-chan time.Time {
    return time.After(d)

TimeAfter is used by the sleep command to obtain a channel that is delivered a value after the specified time.

It is a variable to allow for unit tests to efficiently test the behavior of the `sleep` command, both by eliminating an actual sleep and verifying the duration was properly parsed.

func GetCompilationError Uses

func GetCompilationError(e interface{}) (*diag.Error, bool)

GetCompilationError returns a *diag.Error and true if the given value is a compilation error. Otherwise it returns nil and false.

func ListenInterrupts Uses

func ListenInterrupts() (<-chan struct{}, func())

ListenInterrupts returns a channel that is closed when SIGINT or SIGQUIT has been received by the process. It also returns a function that should be called when the channel is no longer needed.

func MakePipelineError Uses

func MakePipelineError(excs []*Exception) error

MakePipelineError builds an error from the execution results of multiple commands in a pipeline.

If all elements are either nil or OK, it returns nil. If there is exactly non-nil non-OK Exception, it returns it. Otherwise, it return a PipelineError built from the slice, with nil items turned into OK's for easier access from Elvish code.

func NewCompilationError Uses

func NewCompilationError(message string, context diag.Context) error

NewCompilationError creates a new compilation error.

func NewEnvListVar Uses

func NewEnvListVar(name string) vars.Var

NewEnvListVar returns a variable whose value is a list synchronized with an environment variable with the elements joined by os.PathListSeparator.

Elements in the value of the variable must be strings, and cannot contain os.PathListSeparator or \0; attempting to put any in its elements will result in an error.

func NewExternalCmdExit Uses

func NewExternalCmdExit(name string, ws syscall.WaitStatus, pid int) error

NewExternalCmdExit constructs an error for representing a non-zero exit from an external command.

func NewPwdVar Uses

func NewPwdVar(ev *Evaler) vars.Var

NewPwdVar returns a variable who value is synchronized with the path of the current working directory.

func Reason Uses

func Reason(err error) error

Reason returns the Reason field if err is an *Exception. Otherwise it returns err itself.

func SplitIncompleteQNameFirstNs Uses

func SplitIncompleteQNameFirstNs(qname string) (ns, rest string)

SplitIncompleteQNameNsFirst splits an incomplete qualified variable name into the first part and the rest.

func SplitQNameNs Uses

func SplitQNameNs(qname string) (ns, name string)

SplitQNameNs splits a qualified variable name into the namespace part and the name part.

func SplitQNameNsFirst Uses

func SplitQNameNsFirst(qname string) (ns, rest string)

SplitQNameNs splits a qualified variable name into the first part and the rest.

func SplitQNameNsIncomplete Uses

func SplitQNameNsIncomplete(qname string) (ns, name string)

SplitQNameNs splits an incomplete qualified variable name into the namespace part and the name part.

func SplitQNameNsSegs Uses

func SplitQNameNsSegs(qname string) []string

SplitQNameNsSegs splits a qualified name into namespace segments.

func SplitVariableRef Uses

func SplitVariableRef(ref string) (sigil string, qname string)

SplitVariableRef splits a variable reference into the sigil and the (qualified) name.

type Callable Uses

type Callable interface {
    // Call calls the receiver in a Frame with arguments and options.
    Call(fm *Frame, args []interface{}, opts map[string]interface{}) error

Callable wraps the Call method.

func NewGoFn Uses

func NewGoFn(name string, impl interface{}) Callable

NewGoFn wraps a Go function into an Elvish function using reflection.

Parameters are passed following these rules:

1. If the first parameter of function has type *Frame, it gets the current call frame.

2. If (possibly after a *Frame parameter) the first parameter has type RawOptions, it gets a map of options. If the function has not declared an RawOptions parameter but is passed options, an error is thrown.

Alternatively, a (non-pointer) struct argument whose type implements the Options interface can also be declared, in which case options will be scanned into it using RawOptions.Scan. If the pointer type of the struct implements a SetDefault method, it will be called before scanning.

3. If the last parameter is non-variadic and has type Inputs, it represents an optional parameter that contains the input to this function. If the argument is not supplied, the input channel of the Frame will be used to supply the inputs.

4. Other parameters are converted using elvToGo.

Return values go to the channel part of the stdout port, after being converted using goToElv. If the last return value has type error and is not nil, it is turned into an exception and no outputting happens. If the last return value is a nil error, it is ignored.

type Editor Uses

type Editor interface {
    Notify(string, ...interface{})

Editor is the interface that the line editor has to satisfy. It is needed so that this package does not depend on the edit package.

type EvalCfg Uses

type EvalCfg struct {
    // Ports used in evaluation. Must contain at least 3 elements; the Eval
    // method panics otherwise.
    Ports []*Port
    // Callback to get a channel of interrupt signals and a function to call
    // when the channel is no longer needed.
    Interrupt func() (<-chan struct{}, func())
    // Whether the Eval method should try to put the Elvish in the foreground
    // after evaluating the Op.
    PutInFg bool

EvalCfg keeps configuration for the (*Evaler).Eval method.

type Evaler Uses

type Evaler struct {

    // Dependencies.
    // TODO: Remove these dependency by providing more general extension points.
    DaemonClient daemon.Client
    Editor       Editor
    // contains filtered or unexported fields

Evaler is used to evaluate elvish sources. It maintains runtime context shared among all evalCtx instances.

func NewEvaler Uses

func NewEvaler() *Evaler

NewEvaler creates a new Evaler.

func (*Evaler) AddAfterChdir Uses

func (ev *Evaler) AddAfterChdir(f func(string))

AddAfterChdir adds a function to run after changing directory.

func (*Evaler) AddBeforeChdir Uses

func (ev *Evaler) AddBeforeChdir(f func(string))

AddBeforeChdir adds a function to run before changing directory.

func (*Evaler) Chdir Uses

func (ev *Evaler) Chdir(path string) error

Chdir changes the current directory. On success it also updates the PWD environment variable and records the new directory in the directory history. It runs the functions in beforeChdir immediately before changing the directory, and the functions in afterChdir immediately after (if chdir was successful). It returns nil as long as the directory changing part succeeds.

func (*Evaler) Close Uses

func (ev *Evaler) Close() error

Close releases resources allocated when creating this Evaler. Currently this does nothing and always returns a nil error.

func (*Evaler) Compile Uses

func (ev *Evaler) Compile(tree parse.Tree, w io.Writer) (Op, error)

Compile compiles Elvish code in the global scope. If the error is not nil, it can be passed to GetCompilationError to retrieve more details.

func (*Evaler) CompileWithGlobal Uses

func (ev *Evaler) CompileWithGlobal(tree parse.Tree, g Ns, w io.Writer) (Op, error)

CompileWithGlobal compiles Elvish code in an alternative global scope. If the error is not nil, it can be passed to GetCompilationError to retrieve more details.

TODO(xiaq): To use the Op created, the caller must create a Frame and mutate its local scope manually. Consider restructuring the API to make that unnecessary.

func (*Evaler) EachNsInTop Uses

func (ev *Evaler) EachNsInTop(f func(s string))

EachNsInTop calls the passed function for each namespace that can be used from the top context.

func (*Evaler) EachVariableInTop Uses

func (ev *Evaler) EachVariableInTop(ns string, f func(s string))

EachVariableInTop calls the passed function for each variable name in namespace ns that can be found from the top context.

func (*Evaler) Eval Uses

func (ev *Evaler) Eval(op Op, cfg EvalCfg) error

Eval evaluates an Op with the specified configuration.

func (*Evaler) InstallBundled Uses

func (ev *Evaler) InstallBundled(name, src string)

InstallBundled installs a bundled module to the Evaler.

func (*Evaler) InstallDaemonClient Uses

func (ev *Evaler) InstallDaemonClient(client daemon.Client)

InstallDaemonClient installs a daemon client to the Evaler.

func (*Evaler) InstallModule Uses

func (ev *Evaler) InstallModule(name string, mod Ns)

InstallModule installs a module to the Evaler so that it can be used with "use $name" from script.

func (*Evaler) ParseAndCompile Uses

func (ev *Evaler) ParseAndCompile(src parse.Source, w io.Writer) (Op, error)

ParseAndCompile parses and compiles a Source.

func (*Evaler) PurelyEvalCompound Uses

func (ev *Evaler) PurelyEvalCompound(cn *parse.Compound) (string, error)

func (*Evaler) PurelyEvalPartialCompound Uses

func (ev *Evaler) PurelyEvalPartialCompound(cn *parse.Compound, upto int) (string, error)

func (*Evaler) PurelyEvalPrimary Uses

func (ev *Evaler) PurelyEvalPrimary(pn *parse.Primary) interface{}

PurelyEvalPrimary evaluates a primary node without causing any side effects. If this cannot be done, it returns nil.

Currently, only string literals and variables with no @ can be evaluated.

func (*Evaler) SetArgs Uses

func (ev *Evaler) SetArgs(args []string)

SetArgs replaces the $args builtin variable with a vector built from the argument.

func (*Evaler) SetLibDir Uses

func (ev *Evaler) SetLibDir(libDir string)

SetLibDir sets the library directory, in which external modules are to be found.

type Exception Uses

type Exception struct {
    Reason     error
    StackTrace *StackTrace

Exception represents an elvish exception. It is both a Value accessible to elvishscript, and the type of error returned by public facing evaluation methods like (*Evaler)PEval.

func (*Exception) Bool Uses

func (exc *Exception) Bool() bool

Bool returns whether this exception has a nil cause; that is, it is $ok.

func (*Exception) Equal Uses

func (exc *Exception) Equal(rhs interface{}) bool

Equal compares by address.

func (*Exception) Error Uses

func (exc *Exception) Error() string

Error returns the message of the cause of the exception.

func (*Exception) Fields Uses

func (exc *Exception) Fields() vals.StructMap

func (*Exception) Hash Uses

func (exc *Exception) Hash() uint32

Hash returns the hash of the address.

func (*Exception) Kind Uses

func (exc *Exception) Kind() string

Kind returns "exception".

func (*Exception) Repr Uses

func (exc *Exception) Repr(indent int) string

Repr returns a representation of the exception. It is lossy in that it does not preserve the stacktrace.

func (*Exception) Show Uses

func (exc *Exception) Show(indent string) string

Show shows the exception.

type ExternalCmd Uses

type ExternalCmd struct {
    Name string

ExternalCmd is an external command.

func (ExternalCmd) Call Uses

func (e ExternalCmd) Call(fm *Frame, argVals []interface{}, opts map[string]interface{}) error

Call calls an external command.

func (ExternalCmd) Equal Uses

func (e ExternalCmd) Equal(a interface{}) bool

func (ExternalCmd) Hash Uses

func (e ExternalCmd) Hash() uint32

func (ExternalCmd) Kind Uses

func (ExternalCmd) Kind() string

func (ExternalCmd) Repr Uses

func (e ExternalCmd) Repr(int) string

type ExternalCmdExit Uses

type ExternalCmdExit struct {
    CmdName string
    Pid     int

ExternalCmdExit contains the exit status of external commands.

func (ExternalCmdExit) Error Uses

func (exit ExternalCmdExit) Error() string

func (ExternalCmdExit) Fields Uses

func (exit ExternalCmdExit) Fields() vals.StructMap

type FailError Uses

type FailError struct{ Content interface{} }

FailError is an error returned by the "fail" command.

func (FailError) Error Uses

func (e FailError) Error() string

Error returns the string representation of the cause.

func (FailError) Fields Uses

func (e FailError) Fields() vals.StructMap

Fields returns a structmap for accessing fields from Elvish.

type Flow Uses

type Flow uint

Flow is a special type of error used for control flows.

const (
    Return Flow = iota

Control flows.

func (Flow) Error Uses

func (f Flow) Error() string

func (Flow) Fields Uses

func (f Flow) Fields() vals.StructMap

func (Flow) Show Uses

func (f Flow) Show(string) string

Show shows the flow "error".

type Frame Uses

type Frame struct {
    // contains filtered or unexported fields

Frame contains information of the current running function, akin to a call frame in native CPU execution. A Frame is only modified during and very shortly after creation; new Frame's are "forked" when needed.

func NewTopFrame Uses

func NewTopFrame(ev *Evaler, src parse.Source, ports []*Port) *Frame

NewTopFrame creates a top-level Frame.

TODO(xiaq): This should be a method on the Evaler.

func (*Frame) CaptureOutput Uses

func (fm *Frame) CaptureOutput(f func(*Frame) error) ([]interface{}, error)

CaptureOutput captures the output of a given callback that operates on a Frame.

func (*Frame) Close Uses

func (fm *Frame) Close() error

Close releases resources allocated for this frame. It always returns a nil error. It may be called only once.

func (*Frame) Deprecate Uses

func (fm *Frame) Deprecate(msg string, ctx *diag.Context)

Deprecate shows a deprecation message. The message is not shown if the same deprecation message has been shown for the same location before.

func (Frame) EachNsInTop Uses

func (ev Frame) EachNsInTop(f func(s string))

EachNsInTop calls the passed function for each namespace that can be used from the top context.

func (Frame) EachVariableInTop Uses

func (ev Frame) EachVariableInTop(ns string, f func(s string))

EachVariableInTop calls the passed function for each variable name in namespace ns that can be found from the top context.

func (*Frame) ErrorFile Uses

func (fm *Frame) ErrorFile() *os.File

OutputFile returns a file onto which error messages can be written.

func (*Frame) Eval Uses

func (fm *Frame) Eval(op Op) error

Eval evaluates an Op. It is like eval except that it sets fm.srcMeta temporarily to op.src during the evaluation.

func (*Frame) InputChan Uses

func (fm *Frame) InputChan() chan interface{}

InputChan returns a channel from which input can be read.

func (*Frame) InputFile Uses

func (fm *Frame) InputFile() *os.File

InputFile returns a file from which input can be read.

func (*Frame) Interrupts Uses

func (fm *Frame) Interrupts() <-chan struct{}

Interrupts returns a channel that is closed when an interrupt signal comes.

func (*Frame) IsInterrupted Uses

func (fm *Frame) IsInterrupted() bool

IsInterrupted reports whether there has been an interrupt.

func (*Frame) IterateInputs Uses

func (fm *Frame) IterateInputs(f func(interface{}))

IterateInputs calls the passed function for each input element.

func (*Frame) OutputChan Uses

func (fm *Frame) OutputChan() chan<- interface{}

OutputChan returns a channel onto which output can be written.

func (*Frame) OutputFile Uses

func (fm *Frame) OutputFile() *os.File

OutputFile returns a file onto which output can be written.

func (*Frame) PipeOutput Uses

func (fm *Frame) PipeOutput(f func(*Frame) error, valuesCb func(<-chan interface{}), bytesCb func(*os.File)) error

PipeOutput calls a callback with output piped to the given output handlers.

func (*Frame) ResolveVar Uses

func (fm *Frame) ResolveVar(qname string) vars.Var

ResolveVar resolves a variable. When the variable cannot be found, nil is returned.

func (*Frame) SetLocal Uses

func (fm *Frame) SetLocal(ns Ns)

SetLocal changes the local scope of the Frame.

type GlobFlag Uses

type GlobFlag uint
const (
    NoMatchOK GlobFlag = 1 << iota

func (GlobFlag) Has Uses

func (f GlobFlag) Has(g GlobFlag) bool

type GlobPattern Uses

type GlobPattern struct {
    Flags  GlobFlag
    Buts   []string
    TypeCb func(os.FileMode) bool

GlobPattern is en ephemeral Value generated when evaluating tilde and wildcards.

func (GlobPattern) Concat Uses

func (gp GlobPattern) Concat(v interface{}) (interface{}, error)

func (GlobPattern) Index Uses

func (gp GlobPattern) Index(k interface{}) (interface{}, error)

func (GlobPattern) RConcat Uses

func (gp GlobPattern) RConcat(v interface{}) (interface{}, error)

type Inputs Uses

type Inputs func(func(interface{}))

Inputs is the type that the last parameter of a Go-native function can take. When that is the case, it is a callback to get inputs. See the doc of GoFn for details.

type Ns Uses

type Ns map[string]vars.Var

Ns is a map from names to variables.

func (Ns) Add Uses

func (ns Ns) Add(name string, v vars.Var) Ns

Add adds a variable to the namespace and returns the namespace itself.

func (Ns) AddFn Uses

func (ns Ns) AddFn(name string, v Callable) Ns

AddFn adds a function to a namespace. It returns the namespace itself.

func (Ns) AddGoFn Uses

func (ns Ns) AddGoFn(nsName, name string, impl interface{}) Ns

AddGoFn adds a Go function to a namespace. It returns the namespace itself.

func (Ns) AddGoFns Uses

func (ns Ns) AddGoFns(nsName string, fns map[string]interface{}) Ns

AddGoFns adds Go functions to a namespace. It returns the namespace itself.

func (Ns) AddNs Uses

func (ns Ns) AddNs(name string, v Ns) Ns

AddNs adds a sub-namespace to a namespace. It returns the namespace itself.

func (Ns) Clone Uses

func (ns Ns) Clone() Ns

Clone returns a shallow copy of the namespace.

func (Ns) Equal Uses

func (ns Ns) Equal(rhs interface{}) bool

func (Ns) HasName Uses

func (ns Ns) HasName(name string) bool

HasName reports the namespace contains the given name.

func (Ns) Hash Uses

func (ns Ns) Hash() uint32

func (Ns) Index Uses

func (ns Ns) Index(k interface{}) (interface{}, bool)

func (Ns) IterateKeys Uses

func (ns Ns) IterateKeys(f func(interface{}) bool)

func (Ns) Kind Uses

func (Ns) Kind() string

func (Ns) PopName Uses

func (ns Ns) PopName(name string) vars.Var

PopName removes a name from the namespace and returns the variable it used to contain.

func (Ns) Repr Uses

func (ns Ns) Repr(int) string

type Op Uses

type Op struct {
    Inner effectOp
    Src   parse.Source

Op represents an operation on a Frame. It is the result of compiling a piece of source.

type PipelineError Uses

type PipelineError struct {
    Errors []*Exception

PipelineError represents the errors of pipelines, in which multiple commands may error.

func (PipelineError) Error Uses

func (pe PipelineError) Error() string

Error returns a plain text representation of the pipeline error.

func (PipelineError) Fields Uses

func (pe PipelineError) Fields() vals.StructMap

type Port Uses

type Port struct {
    File      *os.File
    Chan      chan interface{}
    CloseFile bool
    CloseChan bool

Port conveys data stream. It always consists of a byte band and a channel band.

func PortsFromFiles Uses

func PortsFromFiles(files [3]*os.File, ev *Evaler) ([3]*Port, func())

PortsFromFiles builds 3 ports from 3 files. It also returns a function that should be called when the ports are no longer needed.

func (*Port) Close Uses

func (p *Port) Close()

Close closes a Port.

func (*Port) Fork Uses

func (p *Port) Fork() *Port

Fork returns a copy of a Port with the Close* flags unset.

type RawOptions Uses

type RawOptions map[string]interface{}

RawOptions is the type of an argument a Go-native function can take to declare that it wants to parse options itself. See the doc of GoFn for details.

type StackTrace Uses

type StackTrace struct {
    Head *diag.Context
    Next *StackTrace

StackTrace represents a stack trace as a linked list of diag.Context. The head is the innermost stack.

Since pipelines can call multiple functions in parallel, all the StackTrace nodes form a DAG.


When evaluating closures, async access to global variables and ports can be problematic.


errsPackage errs declares error types used as exception causes.
mods/bundledPackage bundled manages modules written in Elvish that are bundled with the elvish binary.
mods/daemonPackage daemon implements the builtin daemon: module.
mods/mathPackage math exposes functionality from Go's math package as an elvish module.
mods/platformPackage platform exposes variables and functions that deal with the specific platform being run on, such as the OS name and CPU architecture.
mods/rePackage re implements a regular expression module.
mods/strPackage str exposes functionality from Go's strings package as an Elvish module.
mods/unixPackage unix exports an Elvish namespace that contains variables and functions that deal with features unique to UNIX-like operating systems.
valsPackage vals contains basic facilities for manipulating values used in the Elvish runtime.
varsPackage vars contains basic types for manipulating Elvish variables.

Package eval imports 46 packages (graph) and is imported by 12 packages. Updated 2020-11-16. Refresh now. Tools for package owners.