From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Drew Adams Newsgroups: gmane.emacs.help Subject: RE: Hack for JSON sequences with trailing commas? Date: Thu, 2 Aug 2018 17:51:35 -0700 (PDT) Message-ID: References: < > <> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1533257420 6615 195.159.176.226 (3 Aug 2018 00:50:20 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 3 Aug 2018 00:50:20 +0000 (UTC) To: Barry Margolin , help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Aug 03 02:50:15 2018 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1flOID-0001Ui-UB for geh-help-gnu-emacs@m.gmane.org; Fri, 03 Aug 2018 02:50:10 +0200 Original-Received: from localhost ([::1]:48429 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1flOKK-0004eC-NP for geh-help-gnu-emacs@m.gmane.org; Thu, 02 Aug 2018 20:52:20 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:55656) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1flOJn-0004cq-3g for help-gnu-emacs@gnu.org; Thu, 02 Aug 2018 20:51:49 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1flOJh-00016O-W7 for help-gnu-emacs@gnu.org; Thu, 02 Aug 2018 20:51:47 -0400 Original-Received: from userp2130.oracle.com ([156.151.31.86]:54798) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1flOJh-00014x-Nc for help-gnu-emacs@gnu.org; Thu, 02 Aug 2018 20:51:41 -0400 Original-Received: from pps.filterd (userp2130.oracle.com [127.0.0.1]) by userp2130.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w730oOSM142784; Fri, 3 Aug 2018 00:51:37 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=mime-version : message-id : date : from : sender : to : subject : references : in-reply-to : content-type : content-transfer-encoding; s=corp-2018-07-02; bh=IPSd12WAznapfzgAjMyenJGlO5dJAXNysMmxS7mD/+I=; b=fFjS9SUykbXfFQWiJVmUHNHIK98zJSrNUORu0QqaSM83daGRlbmL5mv/pw5mZWYKqj/K lB8lvdJmUWAX88HtrmdH1Ti/gpmWOr0MlGqL/UknlsL3m04ORrtncKcPu049Kgzok5dX Is0SLlDXz3QNdHg/yLZ//MivkoepUAzz9UdLaU6CGofVRnUJ8FDQPclU+Z38mMbobxD4 otvdSZMc7tlCvlUfQz0xrL9UyXesEmSlE9eGjOzhX2QUJVYQV9AxtHjzbMeORS3PO2Fg vZcAMEfYfR4+sgROc1QzS5OR0ESz7e0edzT40IZPXAlgqnYSn3h2gVhglX8gTv8QGfN3 0w== Original-Received: from userv0022.oracle.com (userv0022.oracle.com [156.151.31.74]) by userp2130.oracle.com with ESMTP id 2kma04gasj-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 03 Aug 2018 00:51:37 +0000 Original-Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by userv0022.oracle.com (8.14.4/8.14.4) with ESMTP id w730pb2H010924 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 3 Aug 2018 00:51:37 GMT Original-Received: from abhmp0011.oracle.com (abhmp0011.oracle.com [141.146.116.17]) by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id w730pa05015784; Fri, 3 Aug 2018 00:51:36 GMT In-Reply-To: <> X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.9.1 (1003210) [OL 16.0.4717.0 (x86)] X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=8973 signatures=668707 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=840 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1807170000 definitions=main-1808030008 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] [fuzzy] X-Received-From: 156.151.31.86 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.org gmane.emacs.help:117628 Archived-At: > > > JSON is a very limited subset of Javascript notation for literals. Ma= ny > > > 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 mo= re > > strict than the latter. > > > > Here is one description of possible differences between the strict synt= ax > > 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 >=20 > 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. It's only permissive if/when you want it to be. You can easily get strict b= ehavior (i.e., per the JSON standard). IOW, you have a choice. And what you want can depend on what you're doing. You might want to be abl= e to store documents that are not strictly well-formed but are well-formed = according to the lax syntax. But you might also want to process such stored= documents in various ways, some of which accept only documents that are st= rictly well-formed. You can specify the behavior you want for storing and f= or various operations. > 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. Yes, that's something different. The JSON spec is one thing. Uses of JSON d= ata in practice are another thing. Only a subset of such uses require docum= ents that adhere to the standard. Sometimes you can't control the kinds of = documents you receive, but you want to be able to process them whether they= strictly conform to the standard or not.