-
-
Notifications
You must be signed in to change notification settings - Fork 189
Range
Giorgio Garofalo edited this page Oct 5, 2024
·
4 revisions
The syntax to define a range is a..b
, with a
and b
non-negative integers, e.g. 2..10
.
Both a
and b
might also be omitted - in that case the range becomes open.
According to the amount of delimiters provided, a range can be classified as:
- Closed range:
a..b
- Open on the left end:
..b
- Open on the right end:
a..
- Open on both ends:
..
The behavior of open ranges is not universally defined, but rather defined by each function that accepts a range.
For instance, the .read
function accepts a range of lines to be read from the file, so 2..10
means only the lines from 2 to 10 (included) will be read.
- If the range is open on the left end (
..10
) it starts reading from the beginning of the file until line 10. - If the range is open on the right end (
2..
) it reads from line 2 to the end of the file. - If the range is open on both ends (
..
) the whole file is read.
This strategy is common for slicing operations across the stdlib.
- Figures
- Image size
- TeX formulas
- Table caption
- Decorative headings
- Alerts (quote types)
- Quotation source
- Page breaks
- Text symbols (text replacement)
- Syntax of a function call
- Declaring functions
- Dynamic typing
- Including other Quarkdown files
- Importing external libraries
- Localization
- Document metadata
- Theme
- CSS
- Fonts
- Page format
- Page margin content
- Page counter
- Automatic page break
- Numbering
- Paragraph style
- Caption position
- Table of contents
- Bibliography
- Stacks (row, column, grid)
- Container
- Align
- Float
- Figure
- Clip
- Box
- Collapsible
- Whitespace
- Variables
- Optionality
- Math
- Conditional statements
- Loops
- Let
- Destructuring
- String manipulation
- Table manipulation: sorting, computing, and more
- Generators
- String
- Number
- Markdown content
- Boolean
- None
- Enumeration entry
- Iterable
- Dictionary
- Range
- Lambda
- Size(s)
- Color
- Dynamic
- Paper: abstract, definitions, theorems, and more