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.4 required=5.0 tests=BAYES_00,FORGED_MUA_MOZILLA autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: a07f3367d7,2f7ef46127892c41 X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII Received: by 10.66.76.130 with SMTP id k2mr1282890paw.16.1342950992046; Sun, 22 Jul 2012 02:56:32 -0700 (PDT) Path: p10ni27646987pbh.1!nntp.google.com!npeer01.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!border3.nntp.dca.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!novia!news-peer1!btnet!zen.net.uk!hamilton.zen.co.uk!xlned.com!feeder3.xlned.com!feeder1.cambriumusenet.nl!feeder3.cambriumusenet.nl!feed.tweaknews.nl!94.232.116.11.MISMATCH!feed.xsnews.nl!border-1.ams.xsnews.nl!plix.pl!newsfeed2.plix.pl!news.mi.ras.ru!goblin1!goblin3!goblin.stu.neva.ru!news.ripco.com!news.glorb.com!dotsrc.org!filter.dotsrc.org!news.dotsrc.org!not-for-mail Date: Tue, 17 Jul 2012 17:06:28 +0200 From: =?ISO-8859-1?Q?Thomas_L=F8cke?= User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:13.0) Gecko/20120710 Thunderbird/13.0.1 MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Little people supporting Ada, possibly through AdaCore? References: <12955589.960.1336138013614.JavaMail.geo-discussion-forums@vbbfk16> <5043095.1117.1336142172111.JavaMail.geo-discussion-forums@vbli11> <2d7fae9a-5be7-4011-a945-5ecd95684025@googlegroups.com> <949570cd-bdda-49ff-93c7-5189546adf7a@googlegroups.com> <5004ff62$0$293$14726298@news.sunsite.dk> In-Reply-To: Message-ID: <50057f74$0$285$14726298@news.sunsite.dk> Organization: SunSITE.dk - Supporting Open source NNTP-Posting-Host: 77.234.168.90 X-Trace: news.sunsite.dk DXC=2SGbT:7b`[5dWg;6EL\fA6YSB=nbEKnk;BeI;]CeQ6;43ZOKe3?:>X1cAE?;m5ccY33>^Oo7SF On 07/17/2012 03:47 PM, Adrian Hoe wrote: > Yeah, but looks like GNATColl.JSON has mixed up the order of objects. So, if objects are created in the order of company_name, vat_no, hours, product and web as in procedure Set_Core_Company_Data then it should be left as it is. The objects should be traversed in the same order as they were created but the output shows company_name, web, product, hours and vat_no. I don't mean it is the job of GNATColl.JSON to sort the objects according to some orders. The question is: Why the objects cannot be traversed in the original order as they are created? If you look at the code you'll see they are using a plain Ada.Containers.Indefinite_Hashed_Maps for storage, and some simple recursion in the Write function. The original order of the objects are lost forever when they are added to a hashed map. There's no sequence, only a collection of JSON_Value objects. There's no way to sort the contents of an Indefinite_Hashed_Maps container without "wasting" processing time, and since order doesn't matter in JSON, I don't think the GNATColl devs have spent an awful lot of time on making sure some sort of arbitrary order is maintained. -- Thomas L�cke | thomas@12boo.net | http://12boo.net