In short, what is the meaning of brackets (parentheses, square or curly)? What to they do and what are they called. These are explained in the articles below.
This is a topic that is difficult to describe easily for all readers as the perspective and vocabulary used by different users will vary. Notably, those who have formal programming training may differ from most others. This note is written with the latter in mind, as they do not have any formal grounding upon which to fall back. Thus for some readers, terminology may vary from that they might otherwise use, but here it is consistent within aTBRef and in Tinderbox use.
A number of non-letter characters described here can have varying names depending on locale (even amongst English speakers) and field of study or experience. There are 4 types of brackets and in the listing below the name used in this section of the documentation is the one in italics:
- ( ). Variously: brackets, round brackets or parentheses.
- [ ]. Variously: brackets, square brackets, crochets.
- { }. Variously: curly brackets, braces.
- < >. Angle brackets. These are not used in action code. However, the same characters are used individually as mathematical operators for 'less-than' and 'more-than'.
Also be aware that the meaning of a 'line' of text is different in action code to the convention of the printed page.
More on specific usages of differing types of non-letter characters in code:
- Semicolon: expression delimiter, code line end
- Semicolon: list and dictionary item delimiter
- Colon: dictionary key-value pair delimiter
- Colon: ad hoc delimiter in some action operators
- Dollar-sign prefix: attribute references
- Dollar-sign prefixed numbers: query back-references
- Dollar-sign prefixed numbers: macro arguments
- Parentheses: attribute 'offset' references (offset addressing)
- Parentheses: arguments for action code operators and user functions
- Parentheses: controlling parsing of code
- Square brackets: lists and nested lists
- Square brackets: dictionary data keys
- Square brackets: list indexes
- Square brackets: dictionary keys with multiple values
- Square brackets: in documentation, optional arguments
- Curly brackets: dictionaries and nested dictionaries
- Curly brackets: defining code blocks
- Caret delimiters: export code operators
- Forward slash: folder delimiter in paths
- Double forward slash: action code comments
- Backslash: escape character
- Full stop: dot-operators
- Comma: function argument delimiter
- Symbols used in Mathematical and Logical operations
- Symbols used in Regular Expressions