Hi,
2016/7/16 Sat 12:06:54 UTC+9 Ken Takata wrote:
> Hi,
>
> The help of type() says:
>
> To avoid the magic numbers it should be used this way: >
> :if type(myvar) == type(0)
> :if type(myvar) == type("")
> :if type(myvar) == type(function("tr"))
> :if type(myvar) == type([])
> :if type(myvar) == type({})
> :if type(myvar) == type(0.0)
> :if type(myvar) == type(v:false)
> :if type(myvar) == type(v:none)
>
> But I don't think this is easy to understand. More badly, we don't have a way
> to get the constants for Job and Channel; we need to use the magic numbers for
> them. Attached patch adds constants for them:
> v:t_number, v:t_string, ..., v:t_job and v:t_channel
>
> What do you think?
And attached patch updates documents for another v: variables.
Regards,
Ken Takata
--
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
---
You received this message because you are subscribed to the Google Groups
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.
# HG changeset patch
# Parent d06abae1f03379256206300c4fef46246aebf89e
diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt
--- a/runtime/doc/eval.txt
+++ b/runtime/doc/eval.txt
@@ -1537,7 +1537,7 @@ v:false A Number with value zero. Used
echo v:false
< v:false ~
That is so that eval() can parse the string back to the same
- value.
+ value. Read-only.
*v:fcs_reason* *fcs_reason-variable*
v:fcs_reason The reason why the |FileChangedShell| event was triggered.
@@ -1684,7 +1684,7 @@ v:none An empty String. Used to put an
echo v:none
< v:none ~
That is so that eval() can parse the string back to the same
- value.
+ value. Read-only.
*v:null* *null-variable*
v:null An empty String. Used to put "null" in JSON. See
@@ -1694,7 +1694,7 @@ v:null An empty String. Used to put "nu
echo v:null
< v:null ~
That is so that eval() can parse the string back to the same
- value.
+ value. Read-only.
*v:oldfiles* *oldfiles-variable*
v:oldfiles List of file names that is loaded from the |viminfo| file on
@@ -1892,7 +1892,7 @@ v:true A Number with value one. Used to
echo v:true
< v:true ~
That is so that eval() can parse the string back to the same
- value.
+ value. Read-only.
*v:val* *val-variable*
v:val Value of the current item of a |List| or |Dictionary|. Only
valid while evaluating the expression used with |map()| and