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 08:22:36 PST From: Mats Weber Newsgroups: comp.lang.ada Subject: Re: ANN: Simple components v 1.3 References: <75ga001eokc2r1aijtvu9d70ck3i6j1p0m@4ax.com> <629d00tlqvu326hi1vsomlmnvkobvbc0bl@4ax.com> User-Agent: MT-NewsWatcher/3.3b1 (PPC Mac OS X) Date: Thu, 15 Jan 2004 17:22:33 +0100 Message-ID: NNTP-Posting-Host: mapc186.epfl.ch X-Trace: epflnews.epfl.ch 1074183753 128.178.42.73 (15 Jan 2004 17:22:33 +0200) Organization: EPFL X-Authenticated-User: 116308 Path: archiver1.google.com!news2.google.com!news.maxwell.syr.edu!irazu.switch.ch!news-zh.switch.ch!switch.ch!epflnews.epfl.ch!matsw Xref: archiver1.google.com comp.lang.ada:4438 Date: 2004-01-15T17:22:33+01:00 List-Id: In article <629d00tlqvu326hi1vsomlmnvkobvbc0bl@4ax.com>, Dmitry A. Kazakov wrote: >Isn't it same as to have just set rather than map? I have Generic_Set: > >generic > type Object_Type is private; > Null_Element : Object_Type; > ... > with function "<" (Left, Right : Object_Type) return Boolean is <>; > with function "=" (Left, Right : Object_Type) return Boolean is <>; >package Generic_Set is I think not, because with maps, you have to be able to extract an item given its key, which you cannot do with Generic_Sets as there is no key type. Following is the function that does that in my package: function Search (Key : Key_Type; Within : Bag) return Item_Type; -- Returns the first item in FROM that has a key equal to KEY. -- NONEXISTENT_KEY will be raised if no such item is -- found in the bag.