Mercurial > vim
comparison runtime/doc/eval.txt @ 23594:d3e064f54890 v8.2.2339
patch 8.2.2339: cannot get the type of a value as a string
Commit: https://github.com/vim/vim/commit/a47e05f04a5a5c0369c949157c24d09cbe64ad6a
Author: Bram Moolenaar <Bram@vim.org>
Date: Tue Jan 12 21:49:00 2021 +0100
patch 8.2.2339: cannot get the type of a value as a string
Problem: Cannot get the type of a value as a string.
Solution: Add typename().
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Tue, 12 Jan 2021 22:00:06 +0100 |
parents | 510088f8c66f |
children | 7b3317e959e3 |
comparison
equal
deleted
inserted
replaced
23593:934ad0b3ba7b | 23594:d3e064f54890 |
---|---|
3014 tr({src}, {fromstr}, {tostr}) String translate chars of {src} in {fromstr} | 3014 tr({src}, {fromstr}, {tostr}) String translate chars of {src} in {fromstr} |
3015 to chars in {tostr} | 3015 to chars in {tostr} |
3016 trim({text} [, {mask} [, {dir}]]) | 3016 trim({text} [, {mask} [, {dir}]]) |
3017 String trim characters in {mask} from {text} | 3017 String trim characters in {mask} from {text} |
3018 trunc({expr}) Float truncate Float {expr} | 3018 trunc({expr}) Float truncate Float {expr} |
3019 type({name}) Number type of variable {name} | 3019 type({expr}) Number type of value {expr} |
3020 typename({expr}) String representation of the type of {expr} | |
3020 undofile({name}) String undo file name for {name} | 3021 undofile({name}) String undo file name for {name} |
3021 undotree() List undo file tree | 3022 undotree() List undo file tree |
3022 uniq({list} [, {func} [, {dict}]]) | 3023 uniq({list} [, {func} [, {dict}]]) |
3023 List remove adjacent duplicates from a list | 3024 List remove adjacent duplicates from a list |
3024 values({dict}) List values in {dict} | 3025 values({dict}) List values in {dict} |
11126 < To check if the v:t_ variables exist use this: > | 11127 < To check if the v:t_ variables exist use this: > |
11127 :if exists('v:t_number') | 11128 :if exists('v:t_number') |
11128 | 11129 |
11129 < Can also be used as a |method|: > | 11130 < Can also be used as a |method|: > |
11130 mylist->type() | 11131 mylist->type() |
11132 | |
11133 | |
11134 typename({expr}) *typename()* | |
11135 Return a string representation of the type of {expr}. | |
11136 Example: > | |
11137 echo typename([1, 2, 3]) | |
11138 list<number> | |
11139 | |
11131 | 11140 |
11132 undofile({name}) *undofile()* | 11141 undofile({name}) *undofile()* |
11133 Return the name of the undo file that would be used for a file | 11142 Return the name of the undo file that would be used for a file |
11134 with name {name} when writing. This uses the 'undodir' | 11143 with name {name} when writing. This uses the 'undodir' |
11135 option, finding directories that exist. It does not check if | 11144 option, finding directories that exist. It does not check if |