Concept
Operator (computer programming)
Overview
In computer programming, an operator is a programming language construct that provides functionality that may not be possible to define as a user-defined function (e.g. sizeof in C) or has syntax different from that of a function (e.g. infix addition as in a+b). Like other programming language concepts, operator has a generally accepted, although debatable, meaning among practitioners.
Some operators are represented with symbols – characters typically not allowed for a function identifier – to allow for presentation that is more familiar looking than typical function syntax. For example, a function that tests for greater-than could be named gt, but many languages provide an infix symbolic operator so that code looks more familiar. For example, this:
if gt(x, y) then return
Can be:
if x > y then return
Some languages allow a language-defined operator to be overridden with user-defined behavior and some allow for user-defined operator symbols.
Operators may also differ semantically from functions. For example, short-circuit Boolean operations evaluate later arguments only if earlier ones are not false.
Overview adapted from Wikipedia (CC BY-SA 4.0; see the article history for authors).
Possible passages
Found by search and not yet checked by a person; they may only mention the idea in passing.
In all these operations the operator lor plays the part of a space-time vector of the first kind. If _f_ represents a space-time vector of the second kind,—lor _f_ denotes a space-time vector of the first kind with the components ∂_f₁₂_/∂_x₂_ + ∂_f₁₃_/∂_x₃_ + ∂_f₁₄_/∂_x₄_, ∂_f₂₁_/∂_x₁_ + ∂_f₂₃_/∂_x₃_ +…
Albert Einstein, The Principle of Relativity
Opens on Operator; names Operator.
_On the contrary,_ It is written: "The things that are of God no man knoweth, but the Spirit of God" (1 Cor. 2:11). _I answer that,_ God understands Himself through Himself. In proof whereof it must be known that although in operations which pass to an external effect, the object of the operation, which is taken as the term, exists outside the operator; nevertheless in operations that remain in the operator, the…
Aquinas Thomas, Summa Theologica, Part I
Names Operator several times.
The condition under which such co-operation may be successfully carried on is that the co-operators shall share alike in the produce. Each thus being enabled to repay himself in food for the expended effort, and being further enabled to achieve other such desired ends as maintenance of family, obtains satisfaction: there is no aggression of one on…
Herbert Spencer, The Data of Ethics
Names Operator twice; opens on Operator.
Related ideas
- Negation
- Logical conjunction
- Mathematical logic
- Number
- Prolog
- Arity
- Computer programming
- Logical disjunction
Place in the tradition
Part of Fuzzy logic.
Explore Operator (computer programming) in the interactive graph →