expr
expr copied to clipboard
Expression language and expression evaluation for Go
It seems map keys that aren't strings get implicitly converted to `string`. For example, the following expressions fail unexpectedly ``` 1 in { 1: 0 } Error: cannot use int...
The improvement comes from the use of a cache to speed up the retrieval of struct fields. This commit also adds a new benchmark to measure the performance gain. ```...
Improve memory handling of function arguments in vm.VM by preallocating a single slice to hold all the arguments for all the function calls. This is based on an estimation made...
why `16141183638984196174.0 == 16141183638984196173.0` is true and uint64 number has error: `16141183638984196173 == 16141183638984196173`
Example from playground: ``` user.Profile?.Address ?? "Unknown address" ``` ``` user: Id: 1 Name: John Doe Group: admin ```
hi, I am using expr for creating a DSL to program music melodies (melrōse.org) . The version (v1.17.5) has support for the operator `if else` but this conflicts with my...
```go package main import ( "fmt" "github.com/antonmedv/expr" ) func main() { env := map[string]any{ "a": func() bool { fmt.Println("a executed"); return true }, "b": func() bool { fmt.Println("b executed"); return...
#841 I don't know if that expected to not throw an error, but seems weird to me. Probably in my use case I could use a `Walk` and check for...
I want to disable some functions, but seems like is not working ```go program, err := expr.Compile(query, expr.Option(func(c *conf.Config) { c.Disabled["all"] = true for name := range c.Disabled { fmt.Println("Disabled...",...