lang: ast, interfaces, interpret: Table should be a well-known type

We use this in enough places, that it's nice to have it as a well-known
alias.
This commit is contained in:
James Shubin
2025-07-07 20:46:13 -04:00
parent 73e641120f
commit d113fcb6d7
4 changed files with 21 additions and 19 deletions

View File

@@ -94,7 +94,7 @@ type Stmt interface {
// Output returns the output that this "program" produces. This output
// is what is used to build the output graph. It requires the input
// table of values that are used to populate each function.
Output(map[Func]types.Value) (*Output, error)
Output(Table) (*Output, error)
}
// Expr represents an expression in the language. Expr implementations must have

View File

@@ -44,6 +44,9 @@ import (
// FuncSig is the simple signature that is used throughout our implementations.
type FuncSig = func(context.Context, []types.Value) (types.Value, error)
// Table is the type of language table fields.
type Table = map[Func]types.Value
// GraphSig is the simple signature that is used throughout our implementations.
// TODO: Rename this?
type GraphSig = func(Txn, []Func) (Func, error)