comp.lang.ada
 help / color / mirror / Atom feed
* Missing features in Ada.Containers
@ 2004-10-08  9:03 Alex R. Mosteo
  2004-10-08  9:49 ` Martin Dowie
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Alex R. Mosteo @ 2004-10-08  9:03 UTC (permalink / raw)


Hi,

another thread as reminded me of some things that I find strange in the 
new Ada.Containers. Maybe the implementation I'm using is still 
incomplete or I'm missing something in the new files (I used Charles 
extensively). Please post your comments.

Of the top of my head I find notable the absence of the "hashed strings" 
container. Now it seems you're alone with a "hashed map" whose keys are 
generic of constrained nature. Thus you must make some leaps to have the 
old (and in my case, most used) hashed string container. Indeed it 
requires ugly conversions between the key type, String, defining the 
hashing function simply to reuse the Ada.Hash_String, etc. It smells so 
wrong to me that I'm almost sure I'm missing something obvious here.

Another bizarre (I suppose it was discussed in the mettings) novelty 
(but really of minor relevance as I see it) is that the "sorted maps" 
functionality is now a child package of the "sorted sets". Not only this 
requires now two instantiations to get a "sorted map" but it imposes the 
use of a "sorted set" even if you don't want one?

I know these comments, accurate or not, come too late... but I've just 
started to use these new containers and even if I did read the past 
discussions about the AI.302, I didn't know the specifics.

Best regards,

A. Mosteo.



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Missing features in Ada.Containers
  2004-10-08  9:03 Missing features in Ada.Containers Alex R. Mosteo
@ 2004-10-08  9:49 ` Martin Dowie
  2004-10-08 12:45   ` Alex R. Mosteo
  2004-10-08 10:07 ` Martin Dowie
  2004-10-08 14:57 ` Matthew Heaney
  2 siblings, 1 reply; 7+ messages in thread
From: Martin Dowie @ 2004-10-08  9:49 UTC (permalink / raw)


> Another bizarre (I suppose it was discussed in the mettings) novelty
> (but really of minor relevance as I see it) is that the "sorted maps"
> functionality is now a child package of the "sorted sets". Not only
> this requires now two instantiations to get a "sorted map" but it
> imposes the use of a "sorted set" even if you don't want one?

Matt is working on wording to not just have "ordered set" and "hashed map"
but also "ordered map" and "hashed set" in the AI. It is very hard to
include /every/(!) possible container type into the standard without the
size of the standard exploding to the point that most of it is taken up with
container libraries!

Hopefully, we can get an IWA for expanding the Ada.Container.* packages in
an orderly fashion...

Cheers

-- Martin






^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Missing features in Ada.Containers
  2004-10-08  9:03 Missing features in Ada.Containers Alex R. Mosteo
  2004-10-08  9:49 ` Martin Dowie
@ 2004-10-08 10:07 ` Martin Dowie
  2004-10-08 12:43   ` Alex R. Mosteo
  2004-10-08 14:57 ` Matthew Heaney
  2 siblings, 1 reply; 7+ messages in thread
From: Martin Dowie @ 2004-10-08 10:07 UTC (permalink / raw)


Alex R. Mosteo wrote:
> Of the top of my head I find notable the absence of the "hashed
> strings" container. Now it seems you're alone with a "hashed map"
> whose keys are generic of constrained nature. Thus you must make some
> leaps to have the old (and in my case, most used) hashed string
> container. Indeed it requires ugly conversions between the key type,
> String, defining the hashing function simply to reuse the
> Ada.Hash_String, etc. It smells so wrong to me that I'm almost sure
> I'm missing something obvious here.

Can't you use "Ada.Containers.Indefinite_Hashed_Maps"?





^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Missing features in Ada.Containers
  2004-10-08 10:07 ` Martin Dowie
@ 2004-10-08 12:43   ` Alex R. Mosteo
  0 siblings, 0 replies; 7+ messages in thread
From: Alex R. Mosteo @ 2004-10-08 12:43 UTC (permalink / raw)


Martin Dowie wrote:
> Alex R. Mosteo wrote:
> 
>>Of the top of my head I find notable the absence of the "hashed
>>strings" container. Now it seems you're alone with a "hashed map"
>>whose keys are generic of constrained nature. Thus you must make some
>>leaps to have the old (and in my case, most used) hashed string
>>container. Indeed it requires ugly conversions between the key type,
>>String, defining the hashing function simply to reuse the
>>Ada.Hash_String, etc. It smells so wrong to me that I'm almost sure
>>I'm missing something obvious here.
> 
> 
> Can't you use "Ada.Containers.Indefinite_Hashed_Maps"?

That's it. I knew I was missing something :( When I looked at the 
package I missed that the Key was unconstrained too.



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Missing features in Ada.Containers
  2004-10-08  9:49 ` Martin Dowie
@ 2004-10-08 12:45   ` Alex R. Mosteo
  2004-10-08 15:04     ` Martin Dowie
  0 siblings, 1 reply; 7+ messages in thread
From: Alex R. Mosteo @ 2004-10-08 12:45 UTC (permalink / raw)


Martin Dowie wrote:
>>Another bizarre (I suppose it was discussed in the mettings) novelty
>>(but really of minor relevance as I see it) is that the "sorted maps"
>>functionality is now a child package of the "sorted sets". Not only
>>this requires now two instantiations to get a "sorted map" but it
>>imposes the use of a "sorted set" even if you don't want one?
> 
> 
> Matt is working on wording to not just have "ordered set" and "hashed map"
> but also "ordered map" and "hashed set" in the AI. It is very hard to
> include /every/(!) possible container type into the standard without the
> size of the standard exploding to the point that most of it is taken up with
> container libraries!

Great. I was somewhat more surprised because Charles already had them. 
Of course, if all combinations were to be provided there are a lot of 
them.  Multiply times two if you want to provide protected versions...

> Hopefully, we can get an IWA for expanding the Ada.Container.* packages in
> an orderly fashion...



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Missing features in Ada.Containers
  2004-10-08  9:03 Missing features in Ada.Containers Alex R. Mosteo
  2004-10-08  9:49 ` Martin Dowie
  2004-10-08 10:07 ` Martin Dowie
@ 2004-10-08 14:57 ` Matthew Heaney
  2 siblings, 0 replies; 7+ messages in thread
From: Matthew Heaney @ 2004-10-08 14:57 UTC (permalink / raw)



"Alex R. Mosteo" <devnull@mailinator.com> wrote in message
news:416657E2.9050503@mailinator.com...
>
> Of the top of my head I find notable the absence of the "hashed strings"
> container. Now it seems you're alone with a "hashed map" whose keys are
> generic of constrained nature. Thus you must make some leaps to have the
> old (and in my case, most used) hashed string container. Indeed it
> requires ugly conversions between the key type, String, defining the
> hashing function simply to reuse the Ada.Hash_String, etc. It smells so
> wrong to me that I'm almost sure I'm missing something obvious here.

The container ada.containers.indefinite_hashed_maps allows both the key and
element types to be indefinite.  All you need to do is instantiate the
indefinite_hashed_maps with type String as the generic actual key type, and
all will be well.


> Another bizarre (I suppose it was discussed in the mettings) novelty
> (but really of minor relevance as I see it) is that the "sorted maps"
> functionality is now a child package of the "sorted sets". Not only this
> requires now two instantiations to get a "sorted map" but it imposes the
> use of a "sorted set" even if you don't want one?

We made a tentative agreement to add both ordered_maps and hashed_sets to
the API.

I suggest you post a note on the ada-comment list to let the ARG know that
you want these containers.


> I know these comments, accurate or not, come too late... but I've just
> started to use these new containers and even if I did read the past
> discussions about the AI.302, I didn't know the specifics.

See the a-c*.ad[sb] files at the http://charles.tigris.org/.

(Don't confuse the a-c*.ad[sb] files with the ai302.containers.* files.
Only the a-c* files are up-to-date.)






^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Missing features in Ada.Containers
  2004-10-08 12:45   ` Alex R. Mosteo
@ 2004-10-08 15:04     ` Martin Dowie
  0 siblings, 0 replies; 7+ messages in thread
From: Martin Dowie @ 2004-10-08 15:04 UTC (permalink / raw)


"Alex R. Mosteo" <devnull@mailinator.com> wrote in message 
news:41668BFA.3050403@mailinator.com...
>> Matt is working on wording to not just have "ordered set" and "hashed 
>> map"
>> but also "ordered map" and "hashed set" in the AI. It is very hard to
>> include /every/(!) possible container type into the standard without the
>> size of the standard exploding to the point that most of it is taken up 
>> with
>> container libraries!
>
> Great. I was somewhat more surprised because Charles already had them. Of 
> course, if all combinations were to be provided there are a lot of them. 
> Multiply times two if you want to provide protected versions...

That doesn't mean that the ARG would accept any new packages...

...but, as we say here in Scotland "Shy bairns don't get sweeties!" :-)





^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2004-10-08 15:04 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-10-08  9:03 Missing features in Ada.Containers Alex R. Mosteo
2004-10-08  9:49 ` Martin Dowie
2004-10-08 12:45   ` Alex R. Mosteo
2004-10-08 15:04     ` Martin Dowie
2004-10-08 10:07 ` Martin Dowie
2004-10-08 12:43   ` Alex R. Mosteo
2004-10-08 14:57 ` Matthew Heaney

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