Giter Club home page Giter Club logo

Comments (4)

StrangeYear avatar StrangeYear commented on August 31, 2024

Or if can get the names and locations of all parameters.it's fine too.

from gval.

skyf0cker avatar skyf0cker commented on August 31, 2024

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.

generikvault avatar generikvault commented on August 31, 2024

@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.

Gigaclank avatar Gigaclank commented on August 31, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.