Marius Gedminas wrote:

> On Sat, Jan 23, 2016 at 07:46:42PM +0100, Bram Moolenaar wrote:
> > 
> > Patch 7.4.1154
> > Problem:    No support for JSON.
> > Solution:   Add jsonencode() and jsondecode().  Also add v:false, v:true,
> >             v:null and v:none.
> 
> Why do we need both v:null and v:none?

Yes, because JSON has the "null" value and we need something for an
empty spot in an array: [1,,3].

> These seem to be unfriendly to vimscript tests:
> 
>     :echo v:false == 0
>     E685: Internal error: get_tv_number()
>     1
> 
>     :echo v:true == v:false
>     E685: Internal error: get_tv_string_buf()
>     E685: Internal error: get_tv_string_buf()
>     1
> 
>     :if v:true | echo "yes" | endif
>     E685: Internal error: get_tv_number()

These should work now.  Please watch out for more.

Background: I first tried using an existing variable type instead of
introducing a new one.  Such as a string with constant value.  But it
quickly becomes a mess.

-- 
Apparently, 1 in 5 people in the world are Chinese.  And there are 5
people in my family, so it must be one of them.  It's either my mum
or my dad.  Or my older brother Colin.  Or my younger brother
Ho-Cha-Chu.  But I think it's Colin.

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