static FormulaUtil() { fm = new FuncMap(); fm.SetFunction("sin", new SinFunction()); fm.SetFunction("cos", new CosFunction()); fm.SetFunction("acos", new AcosFunction()); fm.SetFunction("asin", new AsinFunction()); fm.SetFunction("atan", new AtanFunction()); fm.SetFunction("tan", new TanFunction()); fm.SetFunction("cos", new CosFunction()); fm.SetFunction("max", new MaxFunction()); fm.SetFunction("min", new MinFunction()); fm.SetFunction("abs", new AbsFunction()); fm.SetFunction("log", new LogFunction()); fm.SetFunction("pow", new PowFunction()); fm.SetFunction("mod", new ModFunction()); }
public common(map <@string, ptr <Template> > tmpl = default, option option = default, sync.RWMutex muFuncs = default, FuncMap parseFuncs = default, map <@string, reflect.Value> execFuncs = default) { this.tmpl = tmpl; this.option = option; this.muFuncs = muFuncs; this.parseFuncs = parseFuncs; this.execFuncs = execFuncs; }
// addValueFuncs adds to values the functions in funcs, converting them to reflect.Values. private static void addValueFuncs(map<@string, reflect.Value> @out, FuncMap @in) => func((_, panic, __) =>
// createValueFuncs turns a FuncMap into a map[string]reflect.Value private static map<@string, reflect.Value> createValueFuncs(FuncMap funcMap) { var m = make_map<@string, reflect.Value>(); addValueFuncs(m, funcMap); return m; }