The function parameter model has been modified to support the passing of named parameters
This commit is contained in:
+2
-2
@@ -179,10 +179,10 @@ func (ctx *SimpleStore) DeleteFunc(funcName string) {
|
||||
delete(ctx.funcStore, funcName)
|
||||
}
|
||||
|
||||
func (ctx *SimpleStore) Call(name string, args []any) (result any, err error) {
|
||||
func (ctx *SimpleStore) Call(name string, args map[string]any) (result any, err error) {
|
||||
if info, exists := GetLocalFuncInfo(ctx, name); exists {
|
||||
functor := info.Functor()
|
||||
result, err = functor.Invoke(ctx, name, args)
|
||||
result, err = functor.InvokeNamed(ctx, name, args)
|
||||
} else {
|
||||
err = fmt.Errorf("unknown function %s()", name)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user