Closed rocky closed 10 years ago
Agree, I also plan to remove the context
Carl 2014/01/27 2:42 "R. Bernstein" notifications@github.com:
Currently we have:
env := &eval.Env { ... } ctx := &eval.Ctx{"..."} if expr, err := parser.ParseExpr(line); err != nil { fmt.Printf("parse error: %s\n", err) } else if cexpr, errs := eval.CheckExpr(ctx, expr, env); len(errs) != 0 { for , cerr := range errs { fmt.Printf("%v\n", cerr) } } else if vals, , err := eval.EvalExpr(ctx, cexpr, env); err != nil { fmt.Printf("eval error: %s\n", err) }
I think we want something that removes explicit ParseExpr and CheckExpr calls. That is something like:
env := &eval.Env { ... } if vals, _, err := eval.EvalString("...", env); err != nil { fmt.Printf("eval error: %s\n", err) }
— Reply to this email directly or view it on GitHubhttps://github.com/0xfaded/eval/issues/46 .
Currently we have:
I think we want something that removes explicit ParseExpr and CheckExpr calls. That is something like: