Re: [Json] RFC 7386: correct indentation of the MergePatch function...

Francis Galiegue <fgaliegue@gmail.com> Thu, 30 October 2014 12:39 UTC

Return-Path: <fgaliegue@gmail.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 AAB071A003A for <json@ietfa.amsl.com>; Thu, 30 Oct 2014 05:39:58 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2
X-Spam-Level:
X-Spam-Status: No, score=-2 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_FROM=0.001, SPF_PASS=-0.001] autolearn=ham
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 jtq_LsT1lT69 for <json@ietfa.amsl.com>; Thu, 30 Oct 2014 05:39:56 -0700 (PDT)
Received: from mail-pd0-x233.google.com (mail-pd0-x233.google.com [IPv6:2607:f8b0:400e:c02::233]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 8A16A1A0037 for <json@ietf.org>; Thu, 30 Oct 2014 05:39:56 -0700 (PDT)
Received: by mail-pd0-f179.google.com with SMTP id g10so5101996pdj.10 for <json@ietf.org>; Thu, 30 Oct 2014 05:39:56 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=wWzpInLVmZjUTg5LN20B8SAHpm8Mwed61sqWSDqoufc=; b=YbYPKnsgICqHAMz996pIV2J5TS8OAZt/tZ88FRd6hWQNBqbRcanEPczeJiApRKUcvY 9IMQw9D1bbJGrSSaRyD0W2V4xAOdRq+CL9YjHeaUMAWMGj6xcCwQBA52khuKA90Ureu8 /leBhvNOvCAtc+b7uQ8eZYT+Gc14NwWD8cttEJsto4rjXuKi/rnyU5iwXpft5w/npoXL D55FvzTr5DHD3mwVsf5bGgHoF8XCoVnzK/poF5B2oGduWSavRPPNrsTNcOfotiZlknnc eecXwXOiLPpcxCujcaLpIr+Em4mFcc8+tY9GHWf708S1YMou4s5Yr5AYrbJrbAd9NhTT cMYQ==
MIME-Version: 1.0
X-Received: by 10.70.5.227 with SMTP id v3mr1969545pdv.165.1414672796245; Thu, 30 Oct 2014 05:39:56 -0700 (PDT)
Received: by 10.70.32.165 with HTTP; Thu, 30 Oct 2014 05:39:56 -0700 (PDT)
In-Reply-To: <723AD00E-4935-4B59-B692-370F2D887E27@tzi.org>
References: <CALcybBBHVApdaTw15p74XjHY-_z0+q83Zptw7zrd5mytb2B-ug@mail.gmail.com> <723AD00E-4935-4B59-B692-370F2D887E27@tzi.org>
Date: Thu, 30 Oct 2014 13:39:56 +0100
Message-ID: <CALcybBAPAa91zciV3CRGgSRjD8fFfLDyDdWnnJ7Dr7Rk7bkYjA@mail.gmail.com>
From: Francis Galiegue <fgaliegue@gmail.com>
To: Carsten Bormann <cabo@tzi.org>
Content-Type: text/plain; charset="UTF-8"
Archived-At: http://mailarchive.ietf.org/arch/msg/json/Y_q3np4mdWkdqRL8l6m9IrUhVLg
Cc: json@ietf.org
Subject: Re: [Json] RFC 7386: correct indentation of the MergePatch function...
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: Thu, 30 Oct 2014 12:39:58 -0000

On Thu, Oct 30, 2014 at 12:37 PM, Carsten Bormann <cabo@tzi.org> wrote:
[...]
>
> Unfortunately, not quite.
>
> http://tools.ietf.org/html/draft-ietf-appsawg-json-merge-patch-07
>
> says:
>
>    define MergePatch(Target, Patch):
>      if Patch is an Object:
>        if Target is not an Object:
>          Target = {} # Ignore the contents and set it to an empty Object
>        for each Name/Value pair in Patch:
>          if Value is null:
>            if Name exists in Target:
>              remove the Name/Value pair from Target
>          else:
>            Target[Name] = MergePatch(Target[Name], Value)
>        return Target
>      else:
>        return Patch
>

OK then, might I suggest that the pseudo-language used be independent
of the indentation? This could be another erratum, I guess, only I
don't even know how to "post" an erratum to begin with.

Regards,
-- 
Francis Galiegue, fgaliegue@gmail.com, https://github.com/fge
JSON Schema in Java: http://json-schema-validator.herokuapp.com
Parsers in pure Java: https://github.com/parboiled1/grappa (redde
Caesaris: https://github.com/sirthias)