docs.roxen.comView this page in a printer friendly mode
DocsPike7.0TutorialExpressions
Copyright © 2012, Roxen Internet Software
Suggestions, comments & compliments
manuals@roxen.com
 DEMO  DOCS  PIKE
 COMMUNITY  DOWNLOAD
www.roxen.com

   

Some Terminology
Arithmetical Operations
Operations on Complex Types
Comparison
Logical Expressions
Bitwise Operations
Operations on Sets
Indexing
Assignment
Type Conversions
The Comma Operator
Call and Splice
Operator Precedence and Associativity

The Comma Operator

The comma operator, written as a comma (,) takes two operands. It evaluates its left operand and discards the value. It then evaluates its right operand, and returns that value as the result of the expression.

7 + 3, 6 * 2 // Gives 12
3,14         // Gives 14 (and not pi)

The comma operator is seldom necessary, except in function-like preprocessor macros, which we advise against anyway.

The commas used to separate the arguments in a call to a method, or the elements in an array, are not comma operators.