Expression (computer science): Difference between revisions

Content deleted Content added
m Undid revision 1240105254 by 216.131.21.32 (talk)
Remove statement about undefined expressions from first sentence. While it may be accurate in certain contexts, the first sentence probably isn't the place for it.
Line 1:
{{Short description|Syntactic entity in a programming language with a determinable value}}
In [[computer science]], an '''expression''' is a [[Syntax (programming languages)|syntactic]] entity in a [[programming language]] that may be evaluated to determine its [[value (computer science)|value]].<ref>[[John C. Mitchell|Mitchell, J.]] (2002). Concepts in Programming Languages. Cambridge: Cambridge University Press, ''3.4.1 Statements and Expressions'', p. 26</ref> or fail to terminate, in which case the expression is undefined.<ref>Maurizio Gabbrielli, Simone Martini (2010). Programming Languages - Principles and Paradigms. Springer London, ''6.1 Expressions'', p. 120</ref> It is a combination of one or more [[Constant (programming)|constants]], [[variable (programming)|variable]]s, [[function (programming)|function]]s, and [[operator (programming)|operator]]s that the programming language interprets (according to its particular [[Order of operations|rules of precedence]] and of [[Associative property|association]]) and computes to produce ("to return", in a [[state (computer science)|stateful]] environment) another value. This process, for [[mathematical expression]]s, is called ''evaluation''.
In simple settings, the [[return type|resulting value]] is usually one of various [[primitive data type|primitive types]], such as [[string (computer science)|string]], [[boolean expression|boolean]], or numerical (such as [[integer (computer science)|integer]], [[floating-point number|floating-point]], or [[complex data type|complex]]).