mirror of
https://github.com/go-sylixos/elvish.git
synced 2024-12-13 01:47:51 +08:00
973e8e76e2
Also add a test.
25 lines
535 B
Go
25 lines
535 B
Go
package eval
|
|
|
|
import (
|
|
"reflect"
|
|
|
|
"src.elv.sh/pkg/eval/vals"
|
|
)
|
|
|
|
// Callable wraps the Call method.
|
|
type Callable interface {
|
|
// Call calls the receiver in a Frame with arguments and options.
|
|
Call(fm *Frame, args []any, opts map[string]any) error
|
|
}
|
|
|
|
var (
|
|
// NoArgs is an empty argument list. It can be used as an argument to Call.
|
|
NoArgs = []any{}
|
|
// NoOpts is an empty option map. It can be used as an argument to Call.
|
|
NoOpts = map[string]any{}
|
|
)
|
|
|
|
func init() {
|
|
vals.CallableType = reflect.TypeOf((*Callable)(nil)).Elem()
|
|
}
|