From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no autolearn_force=no version=3.4.4 X-Received: by 2002:aed:224f:: with SMTP id o15mr4100904qtc.86.1572353641941; Tue, 29 Oct 2019 05:54:01 -0700 (PDT) X-Received: by 2002:aca:5d8a:: with SMTP id r132mr3672804oib.119.1572353641634; Tue, 29 Oct 2019 05:54:01 -0700 (PDT) Path: eternal-september.org!reader01.eternal-september.org!feeder.eternal-september.org!news.gegeweb.eu!gegeweb.org!usenet-fr.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!j16no396989qtl.0!news-out.google.com!x9ni445qti.1!nntp.google.com!j16no396984qtl.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Tue, 29 Oct 2019 05:54:01 -0700 (PDT) Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=84.202.199.42; posting-account=bPTmZAoAAAC_6HP9XLKB9aAAxBa6BuOR NNTP-Posting-Host: 84.202.199.42 User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <19c2d3be-d639-4c11-9d3a-e469cb9ab7be@googlegroups.com> Subject: Newbie GNATCOLL question From: reinert Injection-Date: Tue, 29 Oct 2019 12:54:01 +0000 Content-Type: text/plain; charset="UTF-8" Xref: reader01.eternal-september.org comp.lang.ada:57367 Date: 2019-10-29T05:54:01-07:00 List-Id: Hi, GNATCOLL.JSON question: I want to test if an object "state" (JSON_Value) is like "{"name":"blabla"}" which is almost an empty (sub-)object and which I want to avoid to include in the (super-)object "cell". The following code/hack works: ------------------------------------------------------------ declare a : constant JSON_Value := Clone(state); begin a.unset_field(Field_Name => "name"); if not a.is_empty then cell.Set_Field(Field_Name => "state",Field => state); end if; end; ------------------------------------------------------------- I assume this is clumsy. Is there a shorter way? reinert