Re: [Json] serializing sequences of JSON values

"Paul E. Jones" <paulej@packetizer.com> Mon, 10 March 2014 04:10 UTC

Return-Path: <paulej@packetizer.com>
X-Original-To: json@ietfa.amsl.com
Delivered-To: json@ietfa.amsl.com
Received: from localhost (ietfa.amsl.com [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 724651A03C6 for <json@ietfa.amsl.com>; Sun, 9 Mar 2014 21:10:35 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: 0.917
X-Spam-Level:
X-Spam-Status: No, score=0.917 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_ADSP_ALL=0.8, DKIM_SIGNED=0.1, FRT_ADOBE2=2.455, HTML_MESSAGE=0.001, RP_MATCHES_RCVD=-0.547, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, T_DKIM_INVALID=0.01] autolearn=no
Received: from mail.ietf.org ([4.31.198.44]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id xgFkSCmpy6-3 for <json@ietfa.amsl.com>; Sun, 9 Mar 2014 21:10:33 -0700 (PDT)
Received: from dublin.packetizer.com (dublin.packetizer.com [75.101.130.125]) by ietfa.amsl.com (Postfix) with ESMTP id 577D51A03C5 for <json@ietf.org>; Sun, 9 Mar 2014 21:10:33 -0700 (PDT)
Received: from [162.188.85.210] (mb95636d0.tmodns.net [208.54.86.185]) (authenticated bits=0) by dublin.packetizer.com (8.14.5/8.14.5) with ESMTP id s2A4A7dB019382 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 10 Mar 2014 00:10:10 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=packetizer.com; s=dublin; t=1394424614; bh=vEDazpbl/6uzveotl0PiUhiBf0MSzuCdtFGwr9CMn1Y=; h=In-Reply-To:References:MIME-Version:Content-Type: Content-Transfer-Encoding:Subject:From:Date:To:CC:Message-ID; b=MCgM0+gMCxE9a3CKW2/lgqe8QpHK3uqmDuA7WxcJ9rjL0i5oy7IW/IlUPhynfc7SE cRkcD//degWRqUE9HDsUu81t5ecNUi/ObcYSbDKnsDTxkO3U5saYEkX2ofYPmjYWJE GGaHmxquzdV9HvWqE/3xme29qbviKwHhyoPOBn7I=
User-Agent: K-9 Mail for Android
In-Reply-To: <CAGrxA27VHoxkvKH3KkFY5DTRi7a-m0F7+AiH40j8gBmK4et-fw@mail.gmail.com>
References: <c19534113ff9489abcc4402fae3c1f62@BL2PR02MB307.namprd02.prod.outlook.com> <20140309143608.GA14656@mercury.ccil.org> <CAGrxA27VHoxkvKH3KkFY5DTRi7a-m0F7+AiH40j8gBmK4et-fw@mail.gmail.com>
MIME-Version: 1.0
Content-Type: multipart/alternative; boundary="----ZPK1JEB2KM0HBQ0XYL0RQ3345XPXB3"
Content-Transfer-Encoding: 8bit
From: "Paul E. Jones" <paulej@packetizer.com>
Date: Mon, 10 Mar 2014 05:10:00 +0100
To: Tatu Saloranta <tsaloranta@gmail.com>, John Cowan <cowan@mercury.ccil.org>
Message-ID: <c8f56a32-81ad-40df-a68a-f1016204291e@email.android.com>
Archived-At: http://mailarchive.ietf.org/arch/msg/json/YD1psEhh1lrbq43fXQXJnLG3Ojg
X-Mailman-Approved-At: Mon, 10 Mar 2014 00:55:34 -0700
Cc: Barry Leiba <barryleiba@computer.org>, Pete Resnick <presnick@qti.qualcomm.com>, Bjoern Hoehrmann <derhoermi@gmx.net>, Paul Hoffman <paul.hoffman@vpnc.org>, "json@ietf.org" <json@ietf.org>, Tim Bray <tbray@textuality.com>, "Joe Hildebrand (jhildebr)" <jhildebr@cisco.com>, "Matt Miller (mamille2)" <mamille2@cisco.com>, Larry Masinter <masinter@adobe.com>, "rfc7158@schmorp.de" <rfc7158@schmorp.de>
Subject: Re: [Json] serializing sequences of JSON values
X-BeenThere: json@ietf.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: "JavaScript Object Notation \(JSON\) WG mailing list" <json.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/json>, <mailto:json-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/mail-archive/web/json/>
List-Post: <mailto:json@ietf.org>
List-Help: <mailto:json-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/json>, <mailto:json-request@ietf.org?subject=subscribe>
X-List-Received-Date: Mon, 10 Mar 2014 04:10:35 -0000

Those I've used keep track of state only insofar as what is required to write out an object or array. At least those I've used do not keep track of state between serialization calls.

In any case, I won't keep belaboring the issue. It's done.

Paul


-------- Original Message --------
From: Tatu Saloranta <tsaloranta@gmail.com>
Sent: March 9, 2014 6:33:29 PM CET
To: John Cowan <cowan@mercury.ccil.org>
Cc: Larry Masinter <masinter@adobe.com>, Pete Resnick <presnick@qti.qualcomm.com>, Bjoern Hoehrmann <derhoermi@gmx.net>, Paul Hoffman <paul.hoffman@vpnc.org>, "json@ietf.org" <json@ietf.org>, "Paul E. Jones" <paulej@packetizer.com>, Tim Bray <tbray@textuality.com>, "Joe Hildebrand (jhildebr)" <jhildebr@cisco.com>, "Matt Miller (mamille2)" <mamille2@cisco.com>, Barry Leiba <barryleiba@computer.org>, "rfc7158@schmorp.de" <rfc7158@schmorp.de>
Subject: Re: [Json] serializing sequences of JSON values

The way real-life serializers do this is to keep track of state. If a root
value has been output, then insert a separator. If not, then not. Expecting
caller to pass this state would indeed be silly.

I still find it fascinating how much of discussion is based on theoretical
aspect of ifs, whys and maybes. But not in observing how things have been
done for years now.

-+ Tatu +-



On Sun, Mar 9, 2014 at 2:36 PM, John Cowan <cowan@mercury.ccil.org> wrote:

> Larry Masinter scripsit:
>
> > If you want to write out a sequence of JSON values you would write them
> out as an array with [] around and comma separators.
>
> That would be a single JSON value, not a sequence thereof.
>
> --
> Income tax, if I may be pardoned for saying so,         John Cowan
> is a tax on income.  --Lord Macnaghten (1901)           cowan@ccil.org
>
> _______________________________________________
> json mailing list
> json@ietf.org
> https://www.ietf.org/mailman/listinfo/json
>