Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Eval
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
{{short description|Function in a programming language, which evaluates a string}} {{redirects|Evaluation (computer science)|other uses|Evaluation (disambiguation)}} {{lowercase}} {{Use mdy dates|date=April 2025}} {{Use American English|date=April 2025}} In some [[programming language]]s, '''<code>eval</code>''' , short for [[wiktionary:evaluate|evaluate]], is a [[subroutine|function]] which evaluates a string as though it were an [[expression (programming)|expression]] in the language, and returns a [[return value|result]]; in others, it executes multiple lines of code as though they had been included instead of the line including the <code>eval</code>. The input to <code>eval</code> is not necessarily a string; it may be structured representation of code, such as an [[abstract syntax tree]] (like [[Lisp (programming language)|Lisp]] forms), or of special type such as <code>code</code> (as in Python). The analog for a [[Statement (computer science)|statement]] is [[Exec (system call)|exec]], which executes a string (or code in other format) as if it were a statement; in some languages, such as Python, both are present, while in other languages only one of either <code>eval</code> or <code>exec</code> is.
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)