comp.lang.ada
 help / color / mirror / Atom feed
From: "Thomas Løcke" <thomas@12boo.net>
Subject: Re: Little people supporting Ada, possibly through AdaCore?
Date: Tue, 17 Jul 2012 17:06:28 +0200
Date: 2012-07-17T17:06:28+02:00	[thread overview]
Message-ID: <50057f74$0$285$14726298@news.sunsite.dk> (raw)
In-Reply-To: <db936361-76f2-4434-ad04-d7e903b470bb@googlegroups.com>

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





  reply	other threads:[~2012-07-22  9:56 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-04 13:26 Little people supporting Ada, possibly through AdaCore? Patrick
2012-05-04 14:36 ` Marc C
2012-07-16 15:47   ` Adrian Hoe
2012-07-16 18:13     ` Marc C
2012-07-17  1:58       ` Adrian Hoe
2012-07-17  6:00         ` Thomas Løcke
2012-07-17 13:47           ` Adrian Hoe
2012-07-17 15:06             ` Thomas Løcke [this message]
2012-07-18 13:33             ` Marc C
2012-07-18 17:14               ` Dmitry A. Kazakov
2012-07-18 17:49                 ` Simon Wright
2012-07-18 20:57                 ` Vasiliy Molostov
2012-07-19  8:08                   ` Dmitry A. Kazakov
2012-07-19 12:12                     ` Vasiliy Molostov
2012-07-19 13:22                       ` Georg Bauhaus
2012-07-21 17:01                         ` Vasiliy Molostov
2012-07-20  2:51                       ` Randy Brukardt
2012-07-21 17:04                         ` Vasiliy Molostov
2012-07-19  7:45                 ` Maciej Sobczak
2012-07-19  8:23                   ` Dmitry A. Kazakov
2012-07-19 12:42                     ` Maciej Sobczak
2012-07-19 14:05                       ` Dmitry A. Kazakov
2012-07-19  1:01             ` gautier_niouzes
2012-05-04 17:55 ` Manuel Gomez
2012-05-04 19:59   ` okellogg
2012-05-05 17:13     ` Simon Wright
2012-05-06 16:26       ` okellogg
2012-05-06 16:42         ` Yannick Duchêne (Hibou57)
2012-05-06 16:55           ` Simon Wright
2012-05-06 17:21             ` Yannick Duchêne (Hibou57)
2012-05-06 19:33               ` Simon Wright
2012-05-20 13:38         ` okellogg
2012-05-05 14:17   ` Marco
2012-05-06 13:01     ` Lucretia
2012-05-04 19:28 ` gautier_niouzes
2012-05-05 13:28   ` Pascal Obry
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox