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=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,94f331aa4ac6827f X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2004-01-15 06:01:07 PST From: Mats Weber Newsgroups: comp.lang.ada Subject: Re: ANN: Simple components v 1.3 References: <75ga001eokc2r1aijtvu9d70ck3i6j1p0m@4ax.com> User-Agent: MT-NewsWatcher/3.3b1 (PPC Mac OS X) Date: Thu, 15 Jan 2004 15:01:05 +0100 Message-ID: NNTP-Posting-Host: cix-adsl-c43-p159.vtx.ch X-Trace: epflnews.epfl.ch 1074175265 212.147.43.159 (15 Jan 2004 15:01:05 +0200) Organization: EPFL X-Authenticated-User: 116308 Path: archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed.freenet.de!feed.news.tiscali.de!newsfeed.vmunix.org!news.imp.ch!news.imp.ch!130.59.1.10.MISMATCH!news-zh.switch.ch!switch.ch!epflnews.epfl.ch!matsw Xref: archiver1.google.com comp.lang.ada:4435 Date: 2004-01-15T15:01:05+01:00 List-Id: In article <75ga001eokc2r1aijtvu9d70ck3i6j1p0m@4ax.com>, Dmitry A. Kazakov wrote: >>> This release includes generic maps (associative arrays) >http://www.dmitry-kazakov.de/ada/components.htm I have been working on this (generic maps) for quite a while (and a long time ago). What I came up with is that the generic formal key type must be limited private and unconstrained (<>) for the component to be useable in most situations. Here is the generic formal part of my version of maps: generic type Key_Type (<>) is limited private; type Item_Type is private; with function Key_Of (Item : in Item_Type) return Key_Type; with function "=" (X, Y : Key_Type) return Boolean is <>; with function "<" (X, Y : Key_Type) return Boolean is <>; type Count is range <>; -- must include 0 package Bags is ... The big differences is that there is no constraint on Key_Type and that the key is part of each item and is extracted from it with the generic formal function Key_Of. For instance, you can have Key_Type => String, with the above, which you cannot do with your version.