Tyru wrote:

> >> Sorry Bram, I forgot to send this mail to vim_dev.
> >> Send again with +alpha about problems of current JSON features.
> >>
> >> On Sat, Feb 6, 2016 at 11:50 PM, Bram Moolenaar <[email protected]> wrote:
> >> >
> >> >> What do you think about this?
> >> >
> >> > I don't want to spend much time discussing this.  v:null and v:none are
> >> > needed just like JavaScript has null and undefined.
> >> >
> >> > I was thinking of taking this a step further to a more efficient
> >> > encoding that is similar to Javascript.  Unfortunately I haven't been
> >> > able to find a specification. I thought it was used in combination with
> >> > protocol buffers.  Besides empty entries in an array, it also removes
> >> > the quotes around object item names.  It's more efficient and doesn't
> >> > drop any functionality.  We could add protocol buffer support, but let's
> >> > leave that for some other time.
> >> >
> >> > Also keep in mind that when you want to stick to the JSON standard
> >> > (well, one of them), you should not write the string yourself but use a
> >> > library to create it.  Arguments that it's hard to type or spot a
> >> > mistake are hardly relevant.
> >>
> >> Okay.
> >> Now I know you seem to follow JavaScript syntax rather than JSON standard.
> >
> > True.  Perhaps we should split this and add jsencode() / jsdecode().
> 
> Sounds great!
> Do you have the plan to add jsencode() / jsdecode() ?
> Or, will you merge the patch for those functions if I write?

Feel free to make a patch.

> >> But please remind JSON is not only for JavaScript.
> >> It might be used for a communication with Vim and scripts, external
> >> commands, and so on.
> >>
> >> And more, currently, 'jsonencode({"key": v:none})' produces output 
> >> '{"key":}'.
> >> This is not even a correct JavaScript syntax.
> >
> > I'll fix that.
> 
> Thanks!
> Now I confirmed that 7.4.1269 raises an E474 error for the expression.
> But yet it seems to return the string ('{"key":}').
> Is it intentional?

When there is an error it returns what it has.  Would it be better to
return nothing?


-- 
You're as much use as a condom machine at the Vatican.
                  -- Rimmer to Holly in Red Dwarf 'Queeg'

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