From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: yyoncho Newsgroups: gmane.emacs.bugs Subject: bug#41946: 27.0.91; native json parsing: add :empty-object configuration Date: Fri, 19 Jun 2020 11:07:27 +0300 Message-ID: References: <87lfkjzjnq.fsf@gmail.com> <83366rzf69.fsf@gnu.org> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="000000000000f43b7105a86b6231" Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="25905"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 41946@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Jun 19 10:08:10 2020 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jmC4H-0006dO-Lm for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 19 Jun 2020 10:08:09 +0200 Original-Received: from localhost ([::1]:35630 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jmC4G-000655-A6 for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 19 Jun 2020 04:08:08 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:48272) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jmC4A-00064y-O9 for bug-gnu-emacs@gnu.org; Fri, 19 Jun 2020 04:08:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:43519) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jmC4A-0000Mr-ER for bug-gnu-emacs@gnu.org; Fri, 19 Jun 2020 04:08:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jmC4A-0004ls-98 for bug-gnu-emacs@gnu.org; Fri, 19 Jun 2020 04:08:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: yyoncho Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 19 Jun 2020 08:08:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 41946 X-GNU-PR-Package: emacs Original-Received: via spool by 41946-submit@debbugs.gnu.org id=B41946.159255406918322 (code B ref 41946); Fri, 19 Jun 2020 08:08:02 +0000 Original-Received: (at 41946) by debbugs.gnu.org; 19 Jun 2020 08:07:49 +0000 Original-Received: from localhost ([127.0.0.1]:55065 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jmC3x-0004lS-Ip for submit@debbugs.gnu.org; Fri, 19 Jun 2020 04:07:49 -0400 Original-Received: from mail-lf1-f53.google.com ([209.85.167.53]:39934) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jmC3s-0004lC-RK for 41946@debbugs.gnu.org; Fri, 19 Jun 2020 04:07:48 -0400 Original-Received: by mail-lf1-f53.google.com with SMTP id d21so2951930lfb.6 for <41946@debbugs.gnu.org>; Fri, 19 Jun 2020 01:07:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=BMgdlXo7tAaopI9KXcq18Wl8fnCEIgBLCYFa+r/hCbM=; b=ZZGrO8tnaIphFAt4d/NssQ45SloJsvNVXa4moNqRIbAJG1v1ZL46szHm1LTMh8NRmo 2d4NI3ntRKiqfamsvjHtgqaG94kEj4vcZIkrB8/e5XEO6bTYrnIyVvrxlWeUxDwoAeVb SvETFIq4Q/GlIuwc6dOBW6FryS+36cipumz6SFOPp+1ANnIHcesbYXOTqOaOf4J9jlga 6GvCa8btKyq6+bjKU1PbCRiA+3f9p/IRgjmRswD7LzyF1AFeeaJuP2o/rWkjxdL6IslO ml6Do5shTPzU5yNORJpwYqCAS19csXel77K3ApXAhj5LsgPuvp4OLV0xUck5G6HQbT8Y erPg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=BMgdlXo7tAaopI9KXcq18Wl8fnCEIgBLCYFa+r/hCbM=; b=ToIZL5SUrz8Dk/H8ls1jd7hEytYNbPWRL9YC/8/XVJDXqCVvKStaeH5vMSM835apbT YP+PIjE9H9Zh70R5qWD1vsxGP9KuZSQXrTPk8c2mT+nNik3TW6TzXsfpNYVsoDF4WF2f l5wQMF30kuEBBK+kM9UmtMFmttcHvVU9tuHx4hM3n0bVLkNjLoptK8HHMc8KWRrwkSOI sU9LF6WSf8GOMUBZ40ztmNNvuPFjCgKent93xKT3bCz+We2eE1uRTralMsNpQw4HTQKI zyZBiLEnUIAoYbFrZm5zMwZLGqOGeT5RHTHnIquJ8a3kGNge0anGgMhARWviOORQL67d 0LkQ== X-Gm-Message-State: AOAM532b6pXThMQbHUvCBtQWTgbOBobbt9BnTJsVwCq8509JA1cjU4X+ vGYS6C4auIEKakCPJoB5W+2AoogAxUEJH4J+94k= X-Google-Smtp-Source: ABdhPJxD5Uc1udntz799A+mwQfrVM3j5GrKdlSXBWLWHtCc0X/B7YP9GwTitiXTYrgA8jbxidMgPpOAB5vBdqNdKuNo= X-Received: by 2002:ac2:5625:: with SMTP id b5mr1269755lff.209.1592554058692; Fri, 19 Jun 2020 01:07:38 -0700 (PDT) In-Reply-To: <83366rzf69.fsf@gnu.org> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:182174 Archived-At: --000000000000f43b7105a86b6231 Content-Type: text/plain; charset="UTF-8" Sorry, for the short description. Here it is what I can do now: (json-parse-string "{\"a\":null}" :object-type 'plist :null-object :null-object) => (:a :null-object) Here it is what I want to be able to do also: (json-parse-string "{\"a\":{}}" :object-type 'plist :empty-object :empty) => (:a :empty) The purpose of this flag is to be able to distinguish json's null from json's empty object. ATM this could be achieved only by binding null. I want to be able to bind an empty object as well. Thanks, Ivan On Fri, Jun 19, 2020 at 10:30 AM Eli Zaretskii wrote: > > From: Ivan Yonchovski > > Date: Fri, 19 Jun 2020 08:52:57 +0300 > > > > > > This is similar to :null-object/:false-object flags in > > json-parse-string and solves the same issue - inability to distinguish > > json's null from {}. > > I don't think I understand the request. Can you post more details, > please? (Maybe it's some standard JSON feature that I'm not familiar > with?) > --000000000000f43b7105a86b6231 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Sorry, for the short description. Here it is what I can do= now:

(json-parse-string =C2=A0"{\"a\":null}&qu= ot;
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 :object-type 'plist
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 :null-object :null-object)
=3D> (:a :null= -object)

Here it is what I want to be able to do also:
(json-parse-string =C2=A0"{\"a\":{}}"
=C2=A0 =C2=A0= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 :object-type '= plist
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 :empty-object :empty)
=3D> (:a :empty)

= The purpose of this flag is to be able to distinguish json's null from = json's=C2=A0empty object.
ATM this could be achieved only by = binding null. I want to be able to bind an empty object as well.
Thanks,
Ivan

On Fri, Jun 19, 2020= at 10:30 AM Eli Zaretskii <eliz@gnu.org> wrote:
> From: Ivan Yonchovski <yyoncho@gmail.com>
> Date: Fri, 19 Jun 2020 08:52:57 +0300
>
>
> This is similar to :null-object/:false-object flags in
> json-parse-string and solves the same issue - inability to distinguish=
> json's null from {}.

I don't think I understand the request.=C2=A0 Can you post more details= ,
please?=C2=A0 (Maybe it's some standard JSON feature that I'm not f= amiliar
with?)
--000000000000f43b7105a86b6231--