[Feature Request] Allow dots in injected Expr function names
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
调研方向
从 expr.Function 的注册路径以及报告 unknown name pkg 的 Compile 步骤开始。跟踪带点标识符的解析和解析过程,然后验证名为 pkg.NewThing 的注入函数可以通过所示表达式调用,并且现有函数名仍能正确编译。
由索引模型根据 Issue 内容生成。
描述
We'd like to inject effectively an entire package into our Expr environment with a dozen or so methods. We were hoping to be able to effectively treat it like Go's package syntax and do something like:
expr.Function("pkg.NewThing", func(p ...any) (any, error) { }
But pkg. seems disallowed as the Compile step throws an error like:
unknown name pkg (1:9)
| let x = pkg.NewThing([1, 2, 3]); x.String()
| ........^
- 主要语言
- Go
- 星标
- 8.1k
- 派生
- 544
- 平均合并
- 1 天 9 小时
- 30 天内合并 PR
- 25
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
expr-lang/expr 的其他 Issue
-
难度 1/5 1 小时以内 新手友好度 90/100
维护者通常 1 天内回复
-
count() without a predicate compiles for non-bool arrays and fails at run time可能已有人在做 @minilan677-netizen 于 2 天前认领。 未关闭
难度 3/5 1-2 天 新手友好度 25/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 57/100
维护者通常 1 天内回复
-
wontfix
难度 4/5 1-2 天 新手友好度 35/100
维护者通常 1 天内回复
-
`find`, `findIndex`, `first` and `get` are type-checked as the element type where they return nil可能重新可做 关联的 PR 已关闭且未合并。 未关闭
难度 3/5 1-2 天 新手友好度 65/100
维护者通常 1 天内回复
相似的 Issue
-
factory:subtask
难度 1/5 1 小时以内 新手友好度 95/100
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 95/100
OneBusAway/watchdog#470 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 92/100
维护者通常 1 天内回复
-
area: session
难度 2/5 1-3 小时 新手友好度 72/100
charmbracelet/crush#4484 ·
维护者通常 1 天内回复
-
accepted good first issue
难度 1/5 1-3 小时 新手友好度 95/100