Mercurial > vim
comparison runtime/doc/eval.txt @ 25700:d4faa2c5211b
Update runtime files
Commit: https://github.com/vim/vim/commit/89a9c159f23fb7b3e24e6d09068adfc24a73afcb
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun Aug 29 21:55:35 2021 +0200
Update runtime files
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sun, 29 Aug 2021 22:00:05 +0200 |
parents | 000b37efd5fa |
children | 11b656e74444 |
comparison
equal
deleted
inserted
replaced
25699:8088e687c3d7 | 25700:d4faa2c5211b |
---|---|
1 *eval.txt* For Vim version 8.2. Last change: 2021 Aug 13 | 1 *eval.txt* For Vim version 8.2. Last change: 2021 Aug 16 |
2 | 2 |
3 | 3 |
4 VIM REFERENCE MANUAL by Bram Moolenaar | 4 VIM REFERENCE MANUAL by Bram Moolenaar |
5 | 5 |
6 | 6 |
8527 GetExpr()->pyxeval() | 8527 GetExpr()->pyxeval() |
8528 | 8528 |
8529 < {only available when compiled with the |+python| or the | 8529 < {only available when compiled with the |+python| or the |
8530 |+python3| feature} | 8530 |+python3| feature} |
8531 | 8531 |
8532 rand([{expr}]) *rand()* *random* | |
8533 Return a pseudo-random Number generated with an xoshiro128** | |
8534 algorithm using seed {expr}. The returned number is 32 bits, | |
8535 also on 64 bits systems, for consistency. | |
8536 {expr} can be initialized by |srand()| and will be updated by | |
8537 rand(). If {expr} is omitted, an internal seed value is used | |
8538 and updated. | |
8539 | |
8540 Examples: > | |
8541 :echo rand() | |
8542 :let seed = srand() | |
8543 :echo rand(seed) | |
8544 :echo rand(seed) % 16 " random number 0 - 15 | |
8545 < | |
8546 | |
8532 *E726* *E727* | 8547 *E726* *E727* |
8533 range({expr} [, {max} [, {stride}]]) *range()* | 8548 range({expr} [, {max} [, {stride}]]) *range()* |
8534 Returns a |List| with Numbers: | 8549 Returns a |List| with Numbers: |
8535 - If only {expr} is specified: [0, 1, ..., {expr} - 1] | 8550 - If only {expr} is specified: [0, 1, ..., {expr} - 1] |
8536 - If {max} is specified: [{expr}, {expr} + 1, ..., {max}] | 8551 - If {max} is specified: [{expr}, {expr} + 1, ..., {max}] |
8548 range(0) " [] | 8563 range(0) " [] |
8549 range(2, 0) " error! | 8564 range(2, 0) " error! |
8550 < | 8565 < |
8551 Can also be used as a |method|: > | 8566 Can also be used as a |method|: > |
8552 GetExpr()->range() | 8567 GetExpr()->range() |
8553 < | |
8554 | |
8555 rand([{expr}]) *rand()* *random* | |
8556 Return a pseudo-random Number generated with an xoshiro128** | |
8557 algorithm using seed {expr}. The returned number is 32 bits, | |
8558 also on 64 bits systems, for consistency. | |
8559 {expr} can be initialized by |srand()| and will be updated by | |
8560 rand(). If {expr} is omitted, an internal seed value is used | |
8561 and updated. | |
8562 | |
8563 Examples: > | |
8564 :echo rand() | |
8565 :let seed = srand() | |
8566 :echo rand(seed) | |
8567 :echo rand(seed) % 16 " random number 0 - 15 | |
8568 < | 8568 < |
8569 | 8569 |
8570 readblob({fname}) *readblob()* | 8570 readblob({fname}) *readblob()* |
8571 Read file {fname} in binary mode and return a |Blob|. | 8571 Read file {fname} in binary mode and return a |Blob|. |
8572 When the file can't be opened an error message is given and | 8572 When the file can't be opened an error message is given and |