B4P makes use of the following symbols:
Symbols | Description | Explanation |
---|---|---|
{ } | Braces | Specify program blocks Defines sets sets Indexing strings and indexing sets Slicing strings and slicing sets |
( ) | Parentheses | Describes function parameters Calculate contents in parentheses first |
[ ] | Brackets | Variables: Opening bracket symbol must follow after the variable name, where further hierarchical member names and array indexes can be specified Table references: Tables do always begin and end with brackets |
, | Comma | Separates elements in sets, values in function parameters, etc. |
; | Semicolon | Concludes and separates statements |
+ - * / | Arithmetic operators | Used as binary operators, and some as unary and assignment operators |
& | ! | Logical operators | Used as binary operators, and some as unary and assignment operators |
< <= == >= > != | Comparison operators | Compares one value at the left-hand side of this symbol with exactly one value at the right-hand side |
= < > | Comparison operators | Compares one value at the left-hand side with a selection of multiple values or value ranges at the right-hand side |
= | Assignment symbol | Inside statements, equal signs are interpreted as assignment symbols. Example: a[] = b[] = c[] First equal sign is the assignment symbol. The 2nd equal sign compares two variables for being equal. |
.. | Range | Used for slicing strings, slicing sets, and specifying value ranges |
~ | Other operators | Used as unary operators |
++ -- ** | Ad-hoc operators | Used to increment, decrement and scale variables and table entries |
: | Colon | Separates else from subsequent statement Repeat operator for set elements Instructs to access multiple table entries |
^ | Deep prefix/postfix symbol | Deep operators for calculating with sets, vectors and matrices Variable references Nested partial table specifications Transactions: Skip the base variables. |
/* */ // | Comments | Comment blocks and line comments. |
<== <<= <=> | Transaction operators | Used for transactions |
Various symbols can be combined, for example for the assignment operator += to add the calculated result of an expression to the destination.
Note: The single point (.) is interpreted as part of a number (decimal point) if the whole item constitutes a legitimate number, or part of a text.
Inside table references, single points, as long they are not in double quotation marks, may refer to current columns if a table context for partial table specifications with column informaiton is provided.