removed unused commented code

This commit is contained in:
2024-06-05 05:53:02 +02:00
parent 9c29392389
commit 847d85605e
4 changed files with 8 additions and 152 deletions
-16
View File
@@ -40,7 +40,6 @@ func checkFunctionCall(ctx ExprContext, name string, varParams *[]any) (err erro
err = errTooMuchParams(name, info.MaxArgs(), len(*varParams))
}
if err == nil && owner != ctx {
// ctx.RegisterFunc(name, info.Functor(), info.MinArgs(), info.MaxArgs())
ctx.RegisterFuncInfo(info)
}
} else {
@@ -52,7 +51,6 @@ func checkFunctionCall(ctx ExprContext, name string, varParams *[]any) (err erro
func evalFuncCall(parentCtx ExprContext, self *term) (v any, err error) {
ctx := cloneContext(parentCtx)
name, _ := self.tk.Value.(string)
// fmt.Printf("Call %s(), context: %p\n", name, ctx)
params := make([]any, len(self.children), len(self.children)+5)
for i, tree := range self.children {
var param any
@@ -85,20 +83,6 @@ func newFuncDefTerm(tk *Token, args []*term) *term {
}
// -------- eval func def
// func _evalFuncDef(ctx ExprContext, self *term) (v any, err error) {
// bodySpec := self.value()
// if expr, ok := bodySpec.(*ast); ok {
// paramList := make([]string, 0, len(self.children))
// for _, param := range self.children {
// paramList = append(paramList, param.source())
// }
// v = newExprFunctor(expr, paramList, ctx)
// } else {
// err = errors.New("invalid function definition: the body specification must be an expression")
// }
// return
// }
func evalFuncDef(ctx ExprContext, self *term) (v any, err error) {
bodySpec := self.value()
if expr, ok := bodySpec.(*ast); ok {