All Topics  
Expression (programming)

 

   Email Print
   Bookmark   Link






 

Expression (programming)



 
 
An expression in a programming language
Programming language

A programming language is a machine-readable artificial language designed to express computations that can be performed by a machine, particularly a computer....
 is a combination of value
Value (computer science)

In computer science, a value is a sequence of bits that is interpreted according to some data type. It is possible for the same sequence of bits to have different values, depending on the type used to interpret its meaning....
s, variable
Variable

A variable is a symbol that stands for a value that may vary; the term usually occurs in opposition to constant, which is a symbol for a non-varying value, i.e....
s, operator
Operator (programming)

Programming languages generally support a set of operators that are similar to operator. A language may contain a fixed number of built-in operators or it may allow the creation of programmer-defined operators ....
s, and functions that are interpreted (evaluated
Evaluation (disambiguation)

Evaluation is the process of characterizing and appraising something of interest or of determining the value of an expression ....
) according to the particular rules of precedence
Order of operations

In algebra and computer programming, when a number or expression is both preceded and followed by an operator such as minus or multiplication, a rule is needed to specify which operator should be applied first; this rule is known as a precedence rule, or more informally order of operation....
 and of association for a particular programming language, which computes and then produces (returns, in a stateful
State (computer science)

In computer science and automata theory, a state is a unique configuration of information in a program or machine. It is a concept that occasionally extends into some forms of systems programming such as Lexical analysiss and parsers....
 environment) another value. The expression is said to evaluate to that value. As in mathematics
Mathematics

Mathematics is the study of quantity, structure, space, change, and related topics of pattern and form. Mathematicians seek out patterns whether found in numbers, space, natural science, computers, imaginary abstractions, or elsewhere....
, the expression is (or can be said to have) its evaluated value; the expression is a representation of that value.

Expressions may or may not have side effect
Side effect (computer science)

In computer science, a subroutine or expression is said to produce a side effect if it modifies some state_ in addition to returning a value. For example, a function might modify a global or a static variable, modify one of its arguments, write data to a display or file, or read some data from other side-effecting functions....
s.






Discussion
Ask a question about 'Expression (programming)'
Start a new discussion about 'Expression (programming)'
Answer questions from other users
Full Discussion Forum



Encyclopedia


An expression in a programming language
Programming language

A programming language is a machine-readable artificial language designed to express computations that can be performed by a machine, particularly a computer....
 is a combination of value
Value (computer science)

In computer science, a value is a sequence of bits that is interpreted according to some data type. It is possible for the same sequence of bits to have different values, depending on the type used to interpret its meaning....
s, variable
Variable

A variable is a symbol that stands for a value that may vary; the term usually occurs in opposition to constant, which is a symbol for a non-varying value, i.e....
s, operator
Operator (programming)

Programming languages generally support a set of operators that are similar to operator. A language may contain a fixed number of built-in operators or it may allow the creation of programmer-defined operators ....
s, and functions that are interpreted (evaluated
Evaluation (disambiguation)

Evaluation is the process of characterizing and appraising something of interest or of determining the value of an expression ....
) according to the particular rules of precedence
Order of operations

In algebra and computer programming, when a number or expression is both preceded and followed by an operator such as minus or multiplication, a rule is needed to specify which operator should be applied first; this rule is known as a precedence rule, or more informally order of operation....
 and of association for a particular programming language, which computes and then produces (returns, in a stateful
State (computer science)

In computer science and automata theory, a state is a unique configuration of information in a program or machine. It is a concept that occasionally extends into some forms of systems programming such as Lexical analysiss and parsers....
 environment) another value. The expression is said to evaluate to that value. As in mathematics
Mathematics

Mathematics is the study of quantity, structure, space, change, and related topics of pattern and form. Mathematicians seek out patterns whether found in numbers, space, natural science, computers, imaginary abstractions, or elsewhere....
, the expression is (or can be said to have) its evaluated value; the expression is a representation of that value.

Expressions may or may not have side effect
Side effect (computer science)

In computer science, a subroutine or expression is said to produce a side effect if it modifies some state_ in addition to returning a value. For example, a function might modify a global or a static variable, modify one of its arguments, write data to a display or file, or read some data from other side-effecting functions....
s. An expression with side effects does not normally have the property of referential transparency.

See also

  • Statement (programming)
    Statement (programming)

    In computer programming a statement can be thought of as the smallest standalone element of an imperative programming language. A program is formed by a sequence of one or more statements....
     (contrast)
  • Boolean expression
    Boolean expression

    A Boolean expression is an expression that results in a Boolean value, that is, TRUE or FALSE. For example, the value for 5 > 3 is TRUE, the value for "An apple is not a fruit" is FALSE....
  • Expression (mathematics)
    Expression (mathematics)

    In mathematics, the word expression is a term for any well-formed formula combination of mathematical symbols. For example,is an expression, while...
  • evaluation strategy
    Evaluation strategy

    In computer science, an evaluation strategy is a set of rules for determining the evaluation of expression in a programming language. Emphasis is typically placed on subprogram or operators ? an evaluation strategy defines when and in what order the arguments to a function are evaluated, when they are substituted into the function, and wha...