Eval

from Wikipedia, the free encyclopedia

Eval is a special function for metaprogramming , with which an interpreter (or the compiler / runtime system pair ) is instructed to evaluate a code fragment written in the programming language, which is available as a data object, and to return the result of the calculation.

Since any side effects such as the binding of a value to a name are also taken into account, the programming language itself becomes “programmable” with Eval. The first programming language with this feature was Lisp . Since the program code can be difficult to read through the inexperienced use of Eval, many programmers prefer to use more specific mechanisms such as macros or closures , depending on the application . If unchecked user input is passed on to Eval, this can be a major security risk.

Eval is available in the programming languages Perl , Bash , PHP , JavaScript and Python , among others .

Web links