Comments (4)
Or if can get the names and locations of all parameters.it's fine too.
from gval.
I don't think it can be supported appropriately by current implement. If #78 can be implemented, you can use this feature to achieve what you want.
If no one work on this issue, i will try to work on it later in my spare time.
CC @generikvault
from gval.
@skyf0cker yeah sry. gval is a spare time project for me as well. Feel free to make a pull request.
@StrangeYear you can override the calculation itself:
var lang = gval.Full(
gval.InfixNumberOperator("+", func(a, b float64) (interface{}, error) {
fmt.Printf("%d + %d\n", a, b) // or collect it in a more appropiate way
return a + b, nil
}),
gval.InfixNumberOperator(">", func(a, b float64) (interface{}, error) {
fmt.Printf("%d > %d\n", a, b)
return a > b, nil
}),
but you would have to override every operator for this approach. I don't now wether this helps you or not.
from gval.
I Have a similar idea going on in my head at the moment.
Ideally I would like to identify where the expression was "triggered"
say I have (foo > bar) || ( foo > baz)
I would like to be able to know that it was the left side of the operator or the right side that triggered a result to be true
this would help me narrow down the causes of some business logic alerts.
but to also then be able to know the evaluated expression for the relative expression would also benefit debugging greatly.
A workaround is to split out the logic and analyze each expression separately.
@generikvault I assume your suggestion here about the language override would be the simplest approach to achieve something like what I am looking for?
from gval.
Related Issues (20)
- how to visit json node whose key with special characters,like $
- Question on thread safety of concurrent evaluations HOT 2
- NewEvaluableWithContext purpose
- Passing a context to the custom functions HOT 1
- feat request: null safe operator
- feature request: add metadata in evaluable HOT 5
- functions inside expression are evaluated in coroutine and on panic are not recovered thus crashing whole application
- Publish new version for DecimalArithmetic HOT 2
- Allow variables to overload functoins HOT 2
- Allow dashes in identfiers HOT 1
- I need to check string contains using gval expression
- Feature Request: high order functions (collection)
- Evaluating strings with backslashes raises parsing errors HOT 1
- Move `parseIf` operator in `base` HOT 2
- evaluate with operator in value not expected HOT 1
- how to parse complex json with jsonpath?
- Hexadecimal support HOT 2
- Allow single quotes for Strings to allow parsing JSONPath HOT 1
- LineFeed in string results in error on Evaluate
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gval.