Giter VIP home page Giter VIP logo

Comments (4)

madorin avatar madorin commented on July 30, 2024

Thanks @tomotom , i'll check more that example.
The intention was to provide a sample with dynamic arguments count, as "sum" is already defined into php core.

from matex.

nuntius-rex avatar nuntius-rex commented on July 30, 2024

Hi Madorin, This threw me a bit also. I was trying to call generic php math functions, like max() with your syntax. PHP Math functions: http://php.net/manual/en/ref.math.php

I finally got it to work, but I wasn't sure about the Object or what your 'ref' and 'arc' keys were until I studied your script a bit more. So a suggestion would be 1.) an explanation of how function arrays work and are set. 2.) Including PHP's arithmetic functions by default. Thank you for a great script! It is very handy and concise! I plan to study it in more detail and learn from it.

from matex.

madorin avatar madorin commented on July 30, 2024

@nuntius-rex, thanks for suggestions, i'll try to document then better example and source code.
The idea was to not overload engine itself by adding functions that you are not going to use.
We had projects where we need to do just sum and some our custom, no sin, cos etc...
About parameters:
ref - function name [including namespace, class | object etc..]
arc - argument count, if null - any number, unknown
Theoretically all math functions can be included automatically by having a special PHP file that add math function to Evaluator class.

from matex.

nuntius-rex avatar nuntius-rex commented on July 30, 2024

Thanks @madorin I can appreciate the desire to keep things concise, clean and minimal. It's definitely best practice. I am also just adding what I need. Thank you for the clarification on the parameters.

from matex.

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.