diff options
author | Bram Moolenaar <Bram@vim.org> | 2021-01-12 21:49:00 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2021-01-12 21:49:00 +0100 |
commit | a47e05f04a5a5c0369c949157c24d09cbe64ad6a (patch) | |
tree | 7d6a27b717ed6c478f4642fd7af13913a4c07f3b /runtime/doc/eval.txt | |
parent | 64ed4d4398e92ac56a9bbd66d5ec992dd4c335f7 (diff) |
patch 8.2.2339: cannot get the type of a value as a stringv8.2.2339
Problem: Cannot get the type of a value as a string.
Solution: Add typename().
Diffstat (limited to 'runtime/doc/eval.txt')
-rw-r--r-- | runtime/doc/eval.txt | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt index d31ba2d362..76c5548532 100644 --- a/runtime/doc/eval.txt +++ b/runtime/doc/eval.txt @@ -3016,7 +3016,8 @@ tr({src}, {fromstr}, {tostr}) String translate chars of {src} in {fromstr} trim({text} [, {mask} [, {dir}]]) String trim characters in {mask} from {text} trunc({expr}) Float truncate Float {expr} -type({name}) Number type of variable {name} +type({expr}) Number type of value {expr} +typename({expr}) String representation of the type of {expr} undofile({name}) String undo file name for {name} undotree() List undo file tree uniq({list} [, {func} [, {dict}]]) @@ -11129,6 +11130,14 @@ type({expr}) The result is a Number representing the type of {expr}. < Can also be used as a |method|: > mylist->type() + +typename({expr}) *typename()* + Return a string representation of the type of {expr}. + Example: > + echo typename([1, 2, 3]) + list<number> + + undofile({name}) *undofile()* Return the name of the undo file that would be used for a file with name {name} when writing. This uses the 'undodir' |