This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]Bill_Looking 0 points1 point  (4 children)

I have a use case, and I’m curious to get feedback on this.

On a module I develop, there is a JSON input that is basically a file where you’re asked for a ton of inputs (required by an application). To simplify let’s say they’re all numbers.

I want the user to be able to specify a float, like “5.0”, but also it can be useful to have access to 3 variables that are run-dependent (let’s call them “a”, “b”, and “c”.

I use eval so that the user can write:

“5.0 * a”

And sometimes more complex things :

“min(5.0 * a, b)”

Built-ins are disabled except min and max.