Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

自定义注册函数时,获取的参数可以是字符串吗? #19

Open
lpg-it opened this issue Aug 23, 2022 · 1 comment
Open

Comments

@lpg-it
Copy link

lpg-it commented Aug 23, 2022

err := engine.RegFunction("if", 1, func(ast ...engine.ExprAST) float64 {
	a := engine.ExprASTResult(ast[0])
    }

比如这样获取时,a 变量可以是字符串吗?

@dengsgo
Copy link
Owner

dengsgo commented Aug 23, 2022

a := engine.ExprASTResult(ast[0]) 比如这样获取时,a 变量可以是字符串吗?

内部计算使用的是 func(ast ...engine.ExprAST) float64 函数,暂不支持返回字符串

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants