Operator Features in Programming Languages
The following table shows the operator features in several programming languages:
| Programming language | Nonalphanumeric operator symbols | Alphanumeric operator symbols | Prefix | Infix | Postfix | Precedence | Associativity | Overloading | Programmer-defined overloading | Programmer-defined operator symbols |
|---|---|---|---|---|---|---|---|---|---|---|
| ALGOL 68 | +* ** * / % %* %× - + < <= >= > = /= & -:= +:= *:= /:= %:= %*:= +=: :=: :/=:
(All operators have bold Alphanumeric equivalents, c.f. next column. Some have non ASCII equivalents, c.f. below.) ¬ +× ⊥ ↑ ↓ ⌊ ⌈ × ÷ ÷× ÷* □ ≤ ≥ ≠ ∧ ∨ ×:= ÷:= ÷×:= ÷*:= %×:= :≠: |
not abs arg bin entier leng level odd repr round shorten i shl shr up down lwb upb lt le ge gt eq ne and or over mod elem minusab plusab timesab divab overab modab plusto is isnt | Yes | Yes | No | Yes | Infix operators are left associative, prefix operators are right associative | Yes | Yes | Yes |
| C | -> . ! ~ ++ -- + - * & / % << >> < <= > <= == != ^ | && || ?: = += -= *= /= %= &= ^= |= <<= >>= | sizeof | Yes | Yes | Yes | Yes | Yes | Yes | No | No |
| C++ (more) | sizeof new delete throw decltype | Yes | Yes | Yes | Yes | Yes | Yes | Yes | No | |
| Java | new instanceof | Yes | Yes | Yes | Yes | Yes | Yes | No | No | |
| Haskell | + - * / ^ ^^ ** == /= > < >= <= && || >>= >> $ $! . ++ !! : | Yes, by putting a function's name into backticks | Yes | Yes | No | Yes | Yes | Yes, using Type classes | Yes | |
| Pascal | * / + - = < > <> <= >= := | not div mod and or in | Yes | Yes | No | Yes | Yes | Yes | No | No |
| Seed7 | {} -> ** ! + - * / << >> & >< | = <> > >= < <= <& := +:= -:= *:= /:= <<:= >>:= &:= @:= | conv varConv parse conj div rem mdiv mod times mult in not and or digits lpad rpad lpad0 | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes |
| Eiffel | + - * / // = /= | not and or implies "and then" "or else" | Yes | Yes | No | Yes | Yes | No | Yes | Yes |
| Prolog | spy nospy not is mod | Yes | Yes | Yes | Yes | Yes | No | No | Yes | |
| Lisp | Lisp defines all functions and symbols as operators. Following the definition in this page, Lisp has no operators. | Yes | No | No | No | No | No | No | Yes | |
| Smalltalk | (yes - Up to two characters) | (yes - Needs a colon after the keyword) | No | Yes | Yes | No | No | Yes | Yes | Yes |
| Perl | -> ++ -- ** ! ~ \ + - . =~ !~ * / % < > <= >= == != <=> ~~ & | ^ && || ' | print sort chmod chdir rand and or not xor lt gt le ge eq ne cmp x | Yes | Yes | Yes | Yes | Yes | Yes | Yes | No |
Read more about this topic: Operator (computer Programming)
Famous quotes containing the words features, programming and/or languages:
“However much we may differ in the choice of the measures which should guide the administration of the government, there can be but little doubt in the minds of those who are really friendly to the republican features of our system that one of its most important securities consists in the separation of the legislative and executive powers at the same time that each is acknowledged to be supreme, in the will of the people constitutionally expressed.”
—Andrew Jackson (17671845)
“If there is a price to pay for the privilege of spending the early years of child rearing in the drivers seat, it is our reluctance, our inability, to tolerate being demoted to the backseat. Spurred by our success in programming our children during the preschool years, we may find it difficult to forgo in later states the level of control that once afforded us so much satisfaction.”
—Melinda M. Marshall (20th century)
“People in places many of us never heard of, whose names we cant pronounce or even spell, are speaking up for themselves. They speak in languages we once classified as exotic but whose mastery is now essential for our diplomats and businessmen. But what they say is very much the same the world over. They want a decent standard of living. They want human dignity and a voice in their own futures. They want their children to grow up strong and healthy and free.”
—Hubert H. Humphrey (19111978)