all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Barry Margolin <barmar@alum.mit.edu>
To: help-gnu-emacs@gnu.org
Subject: Re: Hack for JSON sequences with trailing commas?
Date: Thu, 02 Aug 2018 18:42:37 -0400	[thread overview]
Message-ID: <barmar-81F7D5.18423702082018@reader.eternal-september.org> (raw)
In-Reply-To: mailman.4559.1533134429.1292.help-gnu-emacs@gnu.org

In article <mailman.4559.1533134429.1292.help-gnu-emacs@gnu.org>,
 Drew Adams <drew.adams@oracle.com> wrote:

> > JSON is a very limited subset of Javascript notation for literals. Many
> > things that are allowed in Javascript source code are not allowed in
> > JSON. The reason is presumably to simplify the design of JSON parsers --
> > they don't have to deal with all possible input formats.
> 
> Yes, but there is a difference between JSON as defined by its standard
> and JSON as it is used in practice in many situations. The former is more
> strict than the latter.
> 
> Here is one description of possible differences between the strict syntax
> of the standard and a lax syntax (one that does allow an extra, final comma):
> 
> https://docs.oracle.com/en/database/oracle/oracle-database/18/adjsn/conditions
> -is-json-and-is-not-json.html#GUID-1B6CFFBE-85FE-41DD-BA14-DD1DE73EAB20

I think Oracle is unusual in being so permissive. I don't think the JSON 
parsers in PHP, Python, or Javascript allow as much as Oracle does.

I think the only common extension to JSON that was commonly allowed was 
allowing the top-level value to be something other than an object or 
array. The JSON spec was recently updated to legitimize this.

-- 
Barry Margolin, barmar@alum.mit.edu
Arlington, MA
*** PLEASE post questions in newsgroups, not directly to me ***


  parent reply	other threads:[~2018-08-02 22:42 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <mailman.4482.1533056121.1292.help-gnu-emacs@gnu.org>
2018-08-01  6:53 ` Hack for JSON sequences with trailing commas? Barry Margolin
2018-08-01  7:22   ` Yuri Khan
2018-08-01  9:58     ` Skip Montanaro
2018-08-01 14:40   ` Drew Adams
     [not found]   ` <mailman.4559.1533134429.1292.help-gnu-emacs@gnu.org>
2018-08-02 22:42     ` Barry Margolin [this message]
     [not found]       ` <mailman.4627.1533257510.1292.help-gnu-emacs@gnu.org>
2018-08-04 23:12         ` Barry Margolin
     [not found]     ` <<barmar-81F7D5.18423702082018@reader.eternal-september.org>
2018-08-03  0:51       ` Drew Adams
2018-07-31 16:58 Skip Montanaro

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=barmar-81F7D5.18423702082018@reader.eternal-september.org \
    --to=barmar@alum.mit.edu \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.