narrowtux / abacus

Parses and evaluates mathematical expressions in Elixir. Inspired by math.js
MIT License
84 stars 18 forks source link

Possibility to disable certain features #26

Closed zefj closed 3 weeks ago

zefj commented 1 year ago

Hey!

Our use case only involves evaluating basic maths and floating point manipulation functions - we would love to be able to disable the evaluation of things we don't need, such as factorial, bitwise, comparison, boolean operators, Enum API, etc.

Do you know of any way we could achieve that right now, and if not, would it be possible to add such a configuration option to the library? For example, a "whitelist" of operations.

narrowtux commented 3 weeks ago

Try combining this library with my library "loppers": https://www.hex.pm/packages/loppers

Since abacus compiles to elixir, you should be able to use loppers to do exactly what you want.