Status: New
Owner: ----
Labels: Type-Defect Priority-Medium

New issue 383 by daviebd...@gmail.com: Add support for marshalling JSON
https://code.google.com/p/vim/issues/detail?id=383

Could vim have a built-in tojson({value}) and fromjson({json}) helpers to serialize and deserialize JSON?

JSON is used in lots of vim plugins like https://github.com/Valloric/YouCompleteMe, https://github.com/google/vim-maktaba, https://github.com/MarcWeber/vim-addon-manager, and eventually Vundle (https://github.com/VundleVim/Vundle.vim/pull/560). These can either use slow hacks or depend on python support, but it would be best if vim just had native, performant support for JSON marshalling built in.

Expected behavior
:echo tojson({'a': [1, 'foo'], 'b': 2.1}) ==# '{"a": [1, "foo"], "b": 2.1}'
  1
  :echo fromjson("[1.0, {}, []]") ==# [1.0, {}, []]
  1
  :echo tojson(fromjson('[null, true, false]')) ==# '[null, true, false]'
  1

Note in the last example there needs to be a way to represent null, true, and false unambiguously even though vim doesn't have these primitives. Also, fromjson() could use an option to translate into standard vim equivalents like '', 1, and 0.

--
You received this message because this project is configured to send all issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings

--
--
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 vim_dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Raspunde prin e-mail lui