summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormityu <mityu.mail@gmail.com>2024-03-29 10:14:41 +0100
committerChristian Brabandt <cb@256bit.org>2024-03-29 10:14:41 +0100
commit7f0bba25952cd0d1b3b4a8f9fb51fa6085d3bd13 (patch)
treede933795273f369ebf41968df5c3dcda5bc2d8cf
parentea95f1a5ad2455c7fd1eee2413ac7a3460ef4f8a (diff)
runtime(doc): Improve docs for empty(), len(), and string() on objects
closes: #14324 Signed-off-by: mityu <mityu.mail@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
-rw-r--r--runtime/doc/builtin.txt16
1 files changed, 8 insertions, 8 deletions
diff --git a/runtime/doc/builtin.txt b/runtime/doc/builtin.txt
index 1f7a4f1bd7..9e57a8cc4a 100644
--- a/runtime/doc/builtin.txt
+++ b/runtime/doc/builtin.txt
@@ -1,4 +1,4 @@
-*builtin.txt* For Vim version 9.1. Last change: 2024 Mar 28
+*builtin.txt* For Vim version 9.1. Last change: 2024 Mar 29
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -2265,8 +2265,8 @@ empty({expr}) *empty()*
- A |Job| is empty when it failed to start.
- A |Channel| is empty when it is closed.
- A |Blob| is empty when its length is zero.
- - An |Object| is empty, when the |empty()| builtin method in
- the object (if present) returns true.
+ - An |Object| is empty, when the empty() method in the object
+ (if present) returns true. |object-empty()|
For a long |List| this is much faster than comparing the
length with zero.
@@ -5485,9 +5485,9 @@ len({expr}) The result is a Number, which is the length of the argument.
When {expr} is a |Blob| the number of bytes is returned.
When {expr} is a |Dictionary| the number of entries in the
|Dictionary| is returned.
- When {expr} is an |Object|, invokes the |len()| method in the
- object (if present) to get the length. Otherwise returns
- zero.
+ When {expr} is an |Object|, invokes the len() method in the
+ object (if present) to get the length (|object-len()|).
+ Otherwise returns zero.
Can also be used as a |method|: >
mylist->len()
@@ -9605,9 +9605,9 @@ string({expr}) Return {expr} converted to a String. If {expr} is a Number,
replaced by "[...]" or "{...}". Using eval() on the result
will then fail.
- For an object, invokes the |string()| method to get a textual
+ For an object, invokes the string() method to get a textual
representation of the object. If the method is not present,
- then the default representation is used.
+ then the default representation is used. |object-string()|
Can also be used as a |method|: >
mylist->string()