2016-06-05 4:27 GMT+03:00 James McCoy <[email protected]>:
> In runtime update 705ada1aff27ecd9c47c690df817d043c2ceb5e2,
> documentation was added indicating that ":echo v:false" would result in
> "false" (and similarly for other related variables).  However, this
> doesn't actually work.  The result is "v:false".
>
> All of ":echo v:false", ":echo string(v:false)", or ":echo ''.v:false"
> do this.  In Neovim, at least the latter result in "false".  The first
> two, like in Vim, display v:false.

Result of `eval(string(v:false))` is supposed to be equal to
`v:false`, so one needs to either make `string()` return `v:false` or
define variable `false` like `count`*. `:echo expr` shares code with
`string(expr)`, so when writing Neovim code I assumed there is not
much sense in bothering with making them return different result.
`''.v:false` was written after Vim (when it was returning `false`),
and I think that this variant is more useful (`v:false` is
*vim-specific, `false` is a predefined constant in many languages).

* It is a special case for historical reasons: `count` lives neither
in global nor in function-local scope and there are no `g:count` or
`l:count` unless you explicitly define them, while e.g. `cnt` means
either `g:cnt` (`g:['cnt']`, global scope) or `l:cnt` (function-local,
`cnt` means `l:['cnt']` when code is run inside a function).

>
> What is the behavior supposed to be?  Do the docs or the code need to be
> updated?
>
> Cheers,
> --
> James
> GPG Key: 4096R/91BF BF4D 6956 BD5D F7B7  2D23 DFE6 91AE 331B A3DB
>
> --
> --
> 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.

-- 
-- 
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.

Raspunde prin e-mail lui