Nikolay Pavlov wrote:

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

Let's update the documentation.


-- 
hundred-and-one symptoms of being an internet addict:
52. You ask a plumber how much it would cost to replace the chair in front of
    your computer with a toilet.

 /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

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