Expression (computer science): Difference between revisions

Content deleted Content added
m Fixing the ___location of periods / full stops
Added hatnote differentiating between mathematical and CS expressions; added links
Tags: Mobile edit Mobile app edit iOS app edit
Line 1:
{{distinguish|expression (mathematics)}}
An '''expression''' in a [[programming language]] is a syntactic entity that may be evaluated to determine its 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> 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.
 
AnIn [[computer science]], an '''expression''' inis a [[Syntax (programming languagelanguages)|syntactic]] isentity in a syntactic[[programming entitylanguage]] that may be evaluated to determine its 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> 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 numerical, [[string (computer science)|string]], [[boolean expression|boolean]], [[complex data type]] or other types.