diff options
author | Jussi Pakkanen <jpakkane@gmail.com> | 2021-05-02 12:42:42 +0300 |
---|---|---|
committer | Jussi Pakkanen <jpakkane@gmail.com> | 2021-05-02 12:42:42 +0300 |
commit | 753954be868ed78b3e339e8811fd1d29eb2af237 (patch) | |
tree | 46ede995e85aa7523f052b653b1aea663adf08d5 /docs/markdown/snippets/range.md | |
parent | b2687e86c87a1dd2e254aeaf3355b3e98b82b730 (diff) | |
download | meson-0.58.0.zip meson-0.58.0.tar.gz meson-0.58.0.tar.bz2 |
Release 0.58.0.0.58.0
Diffstat (limited to 'docs/markdown/snippets/range.md')
-rw-r--r-- | docs/markdown/snippets/range.md | 28 |
1 files changed, 0 insertions, 28 deletions
diff --git a/docs/markdown/snippets/range.md b/docs/markdown/snippets/range.md deleted file mode 100644 index 77635d6..0000000 --- a/docs/markdown/snippets/range.md +++ /dev/null @@ -1,28 +0,0 @@ -## New `range()` function - -``` meson - rangeobject range(stop) - rangeobject range(start, stop[, step]) -``` - -Return an opaque object that can be only be used in `foreach` statements. -- `start` must be integer greater or equal to 0. Defaults to 0. -- `stop` must be integer greater or equal to `start`. -- `step` must be integer greater or equal to 1. Defaults to 1. - -It cause the `foreach` loop to be called with the value from `start` included -to `stop` excluded with an increment of `step` after each loop. - -```meson -# Loop 15 times with i from 0 to 14 included. -foreach i : range(15) - ... -endforeach -``` - -The range object can also be assigned to a variable and indexed. -```meson -r = range(5, 10, 2) -assert(r[2] == 9) -``` - |