Re: [Json] Proposed minimal change for duplicate names in objects

John Cowan <cowan@mercury.ccil.org> Sun, 07 July 2013 18:43 UTC

Return-Path: <cowan@ccil.org>
X-Original-To: json@ietfa.amsl.com
Delivered-To: json@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id ED6A721F9E46 for <json@ietfa.amsl.com>; Sun, 7 Jul 2013 11:43:31 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -3.579
X-Spam-Level:
X-Spam-Status: No, score=-3.579 tagged_above=-999 required=5 tests=[AWL=0.020, BAYES_00=-2.599, RCVD_IN_DNSWL_LOW=-1]
Received: from mail.ietf.org ([12.22.58.30]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Iv6GLrhTEoi0 for <json@ietfa.amsl.com>; Sun, 7 Jul 2013 11:43:27 -0700 (PDT)
Received: from earth.ccil.org (earth.ccil.org [192.190.237.11]) by ietfa.amsl.com (Postfix) with ESMTP id 8B21C21F9DB0 for <json@ietf.org>; Sun, 7 Jul 2013 11:43:27 -0700 (PDT)
Received: from cowan by earth.ccil.org with local (Exim 4.72) (envelope-from <cowan@ccil.org>) id 1Uvtve-0006KH-OB; Sun, 07 Jul 2013 14:43:22 -0400
Date: Sun, 07 Jul 2013 14:43:22 -0400
From: John Cowan <cowan@mercury.ccil.org>
To: Carsten Bormann <cabo@tzi.org>
Message-ID: <20130707184322.GA16880@mercury.ccil.org>
References: <00cd01ce7a9f$19adeaa0$4d09bfe0$@augustcellars.com> <00d701ce7aa6$cc5fe700$651fb500$@augustcellars.com> <CAK3OfOiWrWCvNQneokyycV1Jb98M=UR-U7z0dhxUjzVdf+PwDw@mail.gmail.com> <CAHBU6itdi3B1rWv2TiOYhL1QuOVxrFKt7OTWRoG+6TgV8Bc_uw@mail.gmail.com> <CAK3OfOgOYA5fas0oomF5amjP1bR5F=0+uve7mFD4=FMoEV7sWg@mail.gmail.com> <CAGrxA24y4D62XY-YnbDvKVwNKUickcEFxv1FUhc_yqG4KP-m-w@mail.gmail.com> <CAHBU6iuWLcXv0QKR=Ow8gkzoZLmoZjqYCqXDXR8FLVb7w7M2Tw@mail.gmail.com> <CAGrxA252xregfKViPOH7ustTSwOoorrffwdbUuCrryVxmqHUNw@mail.gmail.com> <20130707180955.GA11346@mercury.ccil.org> <18CB0DCA-36FA-4900-9A56-43ECECF2A21A@tzi.org>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Disposition: inline
In-Reply-To: <18CB0DCA-36FA-4900-9A56-43ECECF2A21A@tzi.org>
User-Agent: Mutt/1.5.20 (2009-06-14)
Sender: John Cowan <cowan@ccil.org>
Cc: "json@ietf.org WG" <json@ietf.org>
Subject: Re: [Json] Proposed minimal change for duplicate names in objects
X-BeenThere: json@ietf.org
X-Mailman-Version: 2.1.12
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: Sun, 07 Jul 2013 18:43:32 -0000

Carsten Bormann scripsit:

> In many JSON designs, the receiver knows the full set of keys ahead
> of time.  In this case, you are better off with conditionally interning
> it (i.e., if I already have the symbol, return it, otherwise keep the
> string around, now we know that it didn't map to a known key).

I don't know any way to do that in Java, because there seems to be no
way to ask if a string is interned except by interning it.

-- 
John Cowan   cowan@ccil.org    http://ccil.org/~cowan
I come from under the hill, and under the hills and over the hills my paths
led. And through the air. I am he that walks unseen.  I am the clue-finder,
the web-cutter, the stinging fly. I was chosen for the lucky number.  --Bilbo